Professional Documents
Culture Documents
TP2
Linux administration
2021/2022
$ls
Syntax :
$ls-l
The command ls supports the -l option which would help you to get more information about
the listed files
Synatx :
- :Regular file, such as an ASCII text file, binary executable, or hard link.
B :Block special file. Block input/output device file such as a physical hard drive.
C :Character special file. Raw input/output device file such as a physical hard drive.
Metacharacters
$ls ch*.doc
Displays all the files, the names of which start with ch and end with .doc
$ls *.doc
* works as meta character which matches with any character. If you want to display all the
files ending with just .doc, then you can use the following command
Hidden Files
To list the invisible files, specify the -a option to ls –
$ ls –a
Syntax :
Creating Files
$ vi filename
Syntax :
Syntax :
Syntax :
Copying Files
$ cp filename copyfile
Syntax :
Renaming Files
$ mv old_file new_file
$ mv filename newfile
Syntax :
Deleting Files
$ rm filename
Syntax :
Home Directory
$cd ~username
Syntax :
Absolute/Relative Pathnames
$pwd
Syntax :
Listing Directories
$ls /usr/local
Syntax :
Creating Directories
$mkdir dirname
$mkdir mydir
$mkdir /tmp/test-dir
$mkdir -p /tmp/amrood/test
Removing Directories
$rmdir dirname
Changing Directories
$cd dirname
Renaming Directories
$mv olddir newdir