Basic Linux Shell Commands

by Geethalakshmi 2009-08-22 13:10:00

Basic Linux Shell Commands:

cd /home/
Will change directory to the /home directory

top
This shows basic information such as uptime, cpu usage, memory usage and processes running.

ls
List all files in a directory.

ls -al
List all files plus hidden files.

ls -alh
List all files and hidden files and display the file size in an easier format.

ps -aux
Show all processes running.

netstat -natp
Show all active tcp connections to your server.

netstat -naup
Show all active udp connections to your server.

tail filename
Show the end contents of a file. This is good for viewing last entries to log files.

who
Show who is logged into shell.

last
Show a list of all accesses to the server ftp and shell.

pwd
shows your current position in the filesystem

locate expression
Will find all files named with 'expression'

find . -type f -exec fgrep -li happy {} ;
Will list all files in the current directory that contain the word 'happy'

chown username.group file.txt
Will change the ownership of file.txt to user 'username and group 'group'

chmod 755 file.cgi
Will change the permissions on file.cgi

cp file.txt file2.txt
Copies file.txt to file2.txt

rm file.txt
Deletes file.txt

exit
Logs you out of shell.

Tagged in:

1592
like
0
dislike
0
mail
flag

You must LOGIN to add comments