Learning UNIX/LINUX Commands for Basic Operations.
*******************************
*********************************
Index of Commands
cat - display or concatenate files
cd - change directory
chmod - change the permissions on a file or directory
cp - copy a file
date - display the current date and time
diff - display differences between text files
file - determine the type of a file
find - find files of a specified name or type
ftp - file transfer program
grep - searches files for a specified string or expression
gzip - compress a file
help - display information about bash builtin commands
info - read online documentation
kill - kill a process
lpr - print out a file
ls - list names of files in a directory
man - display an on-line manual page
mkdir - make a directory
more - scan through a text file page by page
mv - move or rename files or directories
nice - change the priority at which a job is being run
passwd - change your password
ps - list processes
pwd - display the name of your current directory
quota - disk quota and usage
rm - remove files or directories
rmdir - remove a directory
sort - sort and collate lines
ssh - secure remote access
tar - create and use archives of files
********************************************
*********************************************
whoami => to Know the USER name
pwd => Gives Details About Present Working Directory
*************List the Details****************
ls => List out The Files.
ls -a => List Out all files Including Hidden Files.
ls -l => List all files with Permissions.
***********CHANGE DIRECTORY*****************
cd [Directory_Name] => Change Directory
cd => Changes to HOME Directory
cd - => Changes to Previous Directory
cd ../ => Move 1 Directory Back
cd ./ => Represents the Present Directory
**********COPY***************
cp [file1] [file2] => Copies the File1 to File2
cp [file1] [file2] [Path_Directory] =>When there are morethan one file it should be the path of Directory.
***********Create Directory***************
mkdir => Make or Create Directory
mkdir -p del1/del2/del3 => Creates the Multiple Directories with Parent as del1 and next and so on.
***********Remove Files and Folders****************
rm -v [file_name] => removes the File.{-v => Represents Verbose}
rm -r [directory] => Removes the Directory even it is Recursive.{-r =Represent Recursive}
rm -f [directory or file] => Removes either DIrectory or FIle{ -f => Represents Force.}
rmdir -v [Empty_Directory_name] => Removes Only Empty Directories.{-v => Represents Verbose}
*****************Move***********************
mv [file1] [file2] => the Contents of File1 is moved into File2.it is Nothing but Renaming.
mv [file1] [Directory_Path] => Moves the file from Original Place to Mentioned Path.
mv [file1] [file2] [Directory_Path] => Moves all of the mention Files into Given Directory.
***********Change MODE ****************************
chmod 777 [file_name] => Update Previous Values with the New Values.
permissions for Admin,user,group
permissions are -read,write and execute-
*********Password**********************
passwd [ENTER_OLD_PASSWORD] [ENTER NEW PASSWORD]
*******************ShortCUT Keys for Working Under UNIX *********************
Control-a => Move to beginning of line
Control-e =>Move to end of line
Alt-f =>Move forward one word
Alt-b =>Move backwards one word
Control-l =>Clear screen, leaving current lineg
Tab =>Try to automatically complete path
ctrl + c => to end the Process while entering the input through Keyboard.
**********Important Things to Remember**************************
Control-c Cancel (kill) foreground job
Control-z Pause foreground job
jobs List current jobs (started in this command-line)
kill %n Kill job number n
killall name Kill all processes called name
ps Show all running processes (distinct from jobs) regardless of how they were started
fg %n Bring job number n to foreground
bg %n Run job number n in background
program & Start program in background
nohup program Run program in background so it will not stop if you log out. stdout and stderr are redirected to the file nohup.out. Advanced users might like to look at screen instead.
**************PIPES**************************
Definition :::-- a pipe can be used to connect stdout of one command to the stdin of another