Tag Archives: cp/ls/rm commands

Learning bash-commands- tutorial-2

An easy way to learn linux commands-tutorial-2
1. pwd command : To see the current working directory use pwd command.
SYNTAX : pwd
rk10@rk-desktop:~$ pwd
/home/rk10
rk10@rk-desktop:~$
#For more information on cd command just type help cd ,in your bash shell.
2. cp command : It is used for copying the files from one directory to another.Here I am copying the file xyz.txt from home directory to the desktop.
SYNTAX : cp filename destination
rk10@rk-desktop:~/Desktop/test$ ls            #test directory is empty at this time
rk10@rk-desktop:~/Desktop/test$ cd ../
rk10@rk-desktop:~/Desktop$ cp xyz.txt /home/rk10/Desktop/test
rk10@rk-desktop:~/Desktop$ cd test
rk10@rk-desktop:~/Desktop/test$ ls
xyz.txt
rk10@rk-desktop:~/Desktop/test$
3. ls command : It is used to display the files and sub directories in the current working directory.
SYNTAX : ls
rk10@rk-desktop:~/Desktop/security$ ls
black_listed_IP  firestarter-events.txt  my_id
dns1.txt                netstat_1.txt
rk10@rk-desktop:~/Desktop/security$
4. rm command : It is used to delete the file,but note that the files will be deleted permanently.
SYNTAX : rm filename
rk10@rk-desktop:~/Desktop/test$ ls
abc.txt
rk10@rk-desktop:~/Desktop/test$ rm abc.txt
rk10@rk-desktop:~/Desktop/test$ ls
rk10@rk-desktop:~/Desktop/test$