You are on page 1of 3

Notes in LINUX

LINUX FILE SYSTEM:


passwd- change password
pwd - command to determine the particular directory you are currently working on
cd - change to another directory
mkdir - create (make) a directory
mv - move file
cp - copy file
rm - delete file
touch - create an empty file
echo - may be used to create a new file with data using the > redirector operator
cat - may be used to display data of a file
chmod - change the permissions on a file or directory
ls - list the contents of a directory
cal - display calendar
date - display time and date
whoami - show current login or username
who - who are logged in
finger - show users information currently logged in
man - manual, use –k keyword to search a command
umask

Filenames:
 case-sensitive (Myfile, myFILE, myfile are three different files)
 naming convention of files and directories are identical (in lower-case)
 can be up to 256 characters long
 may contain letters, numbers, “-“ (dot), “_” (underscore), and “-“ (dash)
 use of metacharacters like the “?”, “*”, “ “, “$”, “&” and brackets is not recommended since
metacharacters have special meaning to the Linux shell
 “/” cannot be used – represents the top most directory (root) of the file directory tree

File permissions:

Use option –l (for long filename) of ls command to see file permission…

ls –l

-rwxr-xr-x 1 it108 student 23068 Feb 26 2004 archive.sh


-rw-rw-r-- 1 it108 student 12878 Jul 24 21:58 orgchart.gif
-rw-rw-r-- 1 it108 student 2645 Jun 30 08:48 personnel.txt
-rw-r--r-- 1 it108 student 168 Jul 17 11:51 publicity.html
drwxrwxr-x 2 it108 student 1024 Mar 18 16:27 sales
-rw-r----- 1 it108 student 512 Sep 1 07:00 topsecret.inf
-rwxr-xr-x 1 it108 student 2645 Aug 4 11:03 wordmatic

Bit position  9 8 7 6 5 4 3 2 1 0
9- file type: d for directory, file otherwise
876- user (owner) file permission
543- group permission
210- all others or everyone else

r read from file r=4


w write to file w=2
x executable x=1
d directory

chmod – change mode or permission

chmod 777 rwxrwxrwx


chmod 755 rwxr-xr-x
chmod 644 rw-r—r-
chmod 000 ---------

or use the + and -

chmod a-w r-xr-xr-x


chmod go-rwx rwx------

You might also like