Monday, August 20, 2012

Linux commands



ls -> to list files & directories in a directory
ls -l -> to list files/folders in a directory with permission sets

mkdir <directory_name> -> creates a directory
rmdir <dir> -> removes directory

chmod -R 777 * -> gives all permissions to all files & files within subfolders in a directory

vi <file_name> -> editor to open, edit files in terminal
exit -> to close terminal
rm <file_name> -> removes a file
rm -rf <folder_name> to remove directories that are not empty

mv <file_name> <destination_directory> ->  moves a file from a folder to another
mv <directory> <destination_directory> ->  moves a folder from a folder to another
mv <file1> <file2> <destination_directory> -> moves two files in a folder siultaneously

cd <path> -> changes directory path to a particular location
cd .. -> changes directory path to one folder above

cat <file_name> -> show contents of file

Ctrl + L -> to clear terminal screen

ls -u <user_name> -> lists all processes started by a particular user
kill -9 <pid> -> stops the process with a particular pid

./<app> -> to execute an application

locate <folder_name> -> To find a folder in entire PC

1 comment: