Professional Documents
Culture Documents
command -options
command input
command -options input1 input2
pwd
--Present Working Dir
--used to identify path of current folder
ls--list
used to list files and dir
ls -ltr
l--long(Properties of files)
t--time(in default order is desc)
r--reverse
h--human readable format
S--sort mem size(in default order is desc)
a--all, including hidden files(. and ..)
A--all, including hidden files(without . and ..)
F--file format *-->all permission @-->link /--->dir
File Types
- Normal Files or ordinary files
d Dierctory file
l Link file
ls -l
note:
if i create empty file mem of the file is zero
if i create empty dir mem of the dir is 4k
ls -ltr
ls -lSrh
How to list files and dir with with respect to time reverse?
ls -ltr
Dir mauplaion
mkdir---make dir
cd--change dir
mkdir d1
rmdir d1
(.)---current dir
(..)--previous dir
(../..)--2 step back
cd user home dir
note
if i want to remove empty dir i can use rmdir, but is not an empty dir i have to
use rm -r
-r -- reg
Absolute path
-------------
--we hae to mention home with user name no navigte dir
cd /home/user/d1/d2/d3
Relative path
-------------
cd dd1/dd2/dd3
cd ./dd1/dd2/dd3
File
-----
note:
if we want to create new empty file i have to use touch
if file is already exist, created or modified time of file will be change
cat --Concat
cat file_name -we can view file
cat > file_name --create new file with line text or if file already exists info
will replace
cat >> file_name --create new file with line text or if file already exists info
will append
or
Output redirection
cat >>----append
cat >---replace