Documente Academic
Documente Profesional
Documente Cultură
cp reverse_feed_script.sh reverse_feed_script.sh_copy
=================================
To Delete
=================================
rm mail_test.txt
=================================
Counting Words
=================================
$ wc .rhosts
$ wc -l .profile
$ wc -w .rhosts
$ wc -m .profile
$ wc -w -m test_results
$ wc -wm test_results
$ wc -mw test_results
=================================
Copying Files
=================================
$ cp test_results test_results.orig
If the destination is a directory, the copy has the same name as the source but is
located in the destination directory
$ cp test_results work/
If more than two inputs are given, cp treats the last argument as the destination
and the other files as sources
$ cp res.01 res.02 res.03 work/
=================================
Renaming Files
=================================
Syntax : mv source destination
$ mv test_result test_result.orig
$ mv -i ch07 ch07.bak
=================================
Removing Files
=================================
Syntax :rm files
$ rm res.01 res.02
$ rm -i hw1 hw2 hw3
=================================
To view the content of a file
=================================
Syntax : cat files
$ cat hosts
=================================
Counting Words ( wc)
=================================
Syntax : wc [options] files
$ wc .rhosts
$ wc .rhosts .profile
$ wc -l .profile
$ wc -w .rhosts
$ wc -m .profile
=================================
changing directory
=================================
Syntax : cd directory
$ cd /usr/local/bin
$ ls /home /usr/local
=================================
Creating Directories
=================================
Syntax :mkdir directory
$ mkdir hw1
$ mkdir /tmp/test-dir
=================================
Moving Files and Directories
=================================
Syntax : mv source destination
$ mv /home/ranga/names /tmp
=================================
Removing Directories
=================================
You can use two commands to remove directories:
� rmdir
� rm -r