Thursday, July 31, 2008

Linux Commands

1. Use cd to change directories
Ex:
Cd .. – To move up one directorycd /usr/games
Cd\ - To move up all directories

2. Use clear to clear the command prompt
3. Use date to set your server's date and time and view the date and time
To set the Date & time
date MMDDhhmm
4. Use df to check disk space
Ex: df -h –T
5. Use finger to see who's on the system
(Get detailed information about a person who has access to the system.)
6. Use logout to quit using the system
7. Use ls to list files and directories
8. Use man to pull up information about a Linux command
Ex: man -k finger
man ls
9. Use more to read the contents of a file Ex: more test.txt
10. Use passwd to change your current password
11. Use pwd to list the name of your current directory
12. Use nano to start a text editor
The last step is to quit nano, {ctrl} x. If everything has gone well we should be back at the command prompt.
13. The du command prints a summary of the amount of information you have stored in your directories on the mounted disks.
syntax: du [options] path
Options:
-s print the sum of bytes in your directories
-a print a line for each file in your directory
14. The grep command searches text files for a particular word or string of words.
syntax: grep textstring filename(s)
15. head: prints the beginning of a text file
head -n 20 test.txt – print first 20 lines
16. tail: prints the end of a text file
tail -n 20 Test.txt –Print last 20 lines
17. Nice: runs programs/commands at a lower system priority 18. Nohup: runs nice programs even when you’re logged off the system
Ex: nice nohup c program.c .
19. The ps command displays all of the existing processes.
20. To kill a process that is stopped, type: kill pid (Process ID)
21 The stty command allows you to view a listing of your current terminal options
22. To contact someone who is on the system, at the prompt you type: talk accountname
23. Type: mesg n. This prevents others from using talk to reach you.
24. Type: w to view all users’ processes
25. Type History to view previously type or use commands
History > Historycmd.txt –Copy history commands in to file
26. Netstat command simply displays all sockets and server connections
27. ifconfig Command line tool to configure or check all network cards/interfaces
28. rm Removes/deletes directories and files
29. nslookup Checks the domain name and IP information of a server Ex: nslookup www.hostname.com
30. route - Lists the routing tables for your server Ex: route –v
31. cal Display a calendar
32. chmod Change access permissions
Ex: chmod 777 -Give full permision
33. ls view files of directory
34. ls -F view files of directory
35. ls -l show details of files and directory
36. ls -a show hidden files
37. ls *[0-9]* show files and directory containing numbers
38. mkdir test create a directory called 'test'
39 tree show files and directories in a tree starting from root
40. clock –w save date changes on BIOS

1 comment:

philip said...

Sweet Linux tutorial. Good to see interest in Linux. It's my second favorite to UNIX as an OS. Windoze sux! Alright, that was a little immature, but it always cracks me up when some Windoze admin shows me something that they can do, and they think it is so cool, like show one machines display remotely on another machine. And, I'm like, ummm... we could do that in like 1980 with UNIX, for free.