Sie sind auf Seite 1von 3

1) What is the command to check services running on linux?

A) #chkconfig -list 2) How to check the default gateway IP in Linux ? A) #route -rn 3) Check the shell that we are currently in? A)#echo $SHELL 4) Check the disks available ? A) #fdisk -l 5) #finger user 6)#uptime 7)#date 8)#cal 9) #w display information about user

show current uptime show the current date and time

show this month s calendar display who is online who you are logged in as show kernel information cpu information memory information

10) #whoami 11) #uname -a

12)#cat /proc/cpuinfo 13) #cat /proc/meminfo 14) #man command 15) #df 16) #du 17) #free

show the manual for command

show disk usage show directory space usage show memory and swap usage show possible locations of app show which app will be run by default create a tar named file.tar containing files

18) #whereis app 19) #which app

20)# tar cf file.tar files 21) # tar xf file.tar

extract the files from file.tar create a tar with Gzip compression

22) #tar czf file.tar.gz files 23) #tar xzf file.tar.gz 24) #tar cjf file.tar.bz2 25) #tar xjf file.tar.bz2 26) #gzip file

extract a tar using Gzip create a tar with Bzip2 compression extract a tar using Bzip2

compresses file and renames it to file.gz decompresses file.gz back to file

27) # gzip -d file.gz

28) #ping kollu 29) #whois domain 30) #dig domain 31)# dig -x host 32) #wget file

ping host(kollu) and output the results get whois information for domain get DNS information for domain reverse lookup host download file continue a stopped download install a package (Debian) install a package (RPM)

33) #wget -c file 34) #dpkg -i pkg.deb

35) #rpm -Uvh pkg.rpm 36) #ps 37) #top

display your currently active processes display all running processes kill process id pid kill all processes named proc *

38) #kill pid

39) #killall proc 40) #bg 41) #fg 42)#fg n

lists stopped or background jobs; resume a stopped job in the background brings the most recent job to foreground brings job n to the foreground

43) #chmod octal file change the permissions of file to octal, which can be foun d separately for user,group, and world by adding: ? 4 read (r) ? 2 write (w) ? 1 execute (x) Refer The Examples: chmod 777 read, write, execute for all chmod 755 rwx for owner, rx for group and world For more options, see man chmod. 44) # ssh kollu@linux5 connect to host(linux5) as user(kollu) 45)# ssh -p port user@host 46)#grep pattern files 47)#grep -r pattern dir 48)#command | grep pattern 49) #locate file 50) #ls connect to host on port

search for pattern in files search recursively for pattern in dir search for pattern in the output of command

find all instances of file

directory listing formatted listing with hidden files change directory to dir

51) #ls -al 52) #cd dir 53) #cd

change to home

54) #pwd

show current directory create a directory dir delete file delete directory dir force remove file force remove directory dir * copy file1 to file2 copy dir1 to dir2; create dir2 if it doesn t exist

55) #mkdir dir 56)#rm file

57) #rm -r dir 58)#rm -f file 59)#rm -rf dir

60)#cp file1 file2 61)#cp -r dir1 dir2

62) # mv file1 file2 rename or move file1 to file2 if file2 is an existing direc tory, moves file1 into directory file2 63)#ln -s file link 64)# touch file 65)#cat > file 66)#more file 67)#head file 68)#tail file create symbolic link link to file

create or update file places standard input into file output the contents of file output the first 10 lines of file output the last 10 lines of file output the contents of file as it grows, starting with the last

69)#tail -f file 10 lines

Short Cuts: - Ctrl+C halts the current command - Ctrl+Z stops the current command, resume with - fg in the foreground or bg in the background - Ctrl+D log out of current session, similar to exit - Ctrl+W erases one word in the current line - Ctrl+U erases the whole line Ctrl+R type to bring up a recent command - !! repeats the last command - exit log out of current session

Das könnte Ihnen auch gefallen