Vous êtes sur la page 1sur 4

date

cal
cal -y
cal 2018

ls list
cd .. directory roll back
cd - previous working directory
cd / root directory
pwd for absolute path name

--------------------------------
root folders
bin
opt - chrome
tmp
home->user
---------------------------------

ls .. list of parent directory

INODE

inode number
file size
owner info
permission
file type
number of links

-------------

ls -i inode number of file


ls -i / inode number of root directory

---------------------------------------------------------------------------
ln originalfilename hardlink1 same inode number, create hardlink same filesize
---------------------------------------------------------------------------
ln -s orginalfilename softlinkname different inode number, small file same size
---------------------------------------------------------------------------
hardlink not effected by even if original file is deleted

ls -l long listing

ls -a shows all files including hidden files.


.filename for file name will hide it. (.) will hide file.

ls -t list by time

ls -r reverse of alphabetic name


-----------------------------------------------------
list all files in directory and in sub directories

ls -R directoryname

------------------
combining commands
-----------------------------------------------------
ls -i -l long list with inode number
ls -il
-----------------------------------------------------
ls -tr reverse the output of files by time.
------------------------------------------------------

-------------
touch command
-------------

touch filename changes time stamp


touch directoryname change timestamp of directory

touch filename if does not exist then it creates new file

---------
directory
---------

mkdir directoryname new directory


mkdir directoryname1 directoryname2 multiple directories
rmdir directoryname remove directory
rmdir directoryname1 directoryname2 remove multiple directories

does not remove non empty directory

-----
files
-----

rm filename remove files


rm -R will delete all sub directory files and the current directory

rm -i filename warning message before deleting file

rm -f will delete with no confirmation

rm -v gives summary of what happened

rm -R dir1 file1 delete file and directory

----------
copy files
----------

cp filename1 filname2 copies into file2/ will update if file2


exist
cp -R directory1 directory2 copies directory
cp file1 file2 destinationdirectory overwrite files

----------
move files
----------

mv oldfilename newfilename move or rename files


mv filename destinationdirectory move to directory
mv olddir1 newdir2 if dir2 exist it will move olddir in newdir

-------------------------------------
no file extension concept in linux

file filename will give summary of file


---------------------------------------
directory name with space need quotes

mkdir 'dir name' or "dir name"


----------------------------------------

mkdir my\ cat dirname with space


----------------------------------------

mkdir \$dirname special charcter with backslash\

tab button for auto completeion

rm -- will give all options of rm

--------
shortcut
--------
alt+u will make it upper case
alt+l lower case
ctrl+l to clear screen

---------
gedit graphic interface
-------------------------------------
nano filename to access file

--------
history
--------
history will give all commands used
!180 excute command at 180 in history lis
history 20 last 20 commands used

-------------------------
less filename will only display file content
------------------------

cat filename1 file2 will display content on command line


------------------------
tac filename will reverse order of contents

head filename give first 10 lines


tail filename gives last 10 lines

head -n 7 filename gives first 7 lines

wc filename gives description of file(word count)

help and man gives help

whatis cp give description

date; cal for combining commands


&& for combining commands

* everything
? just one character
-----------------------------------------
using alias to make new commands

type aliasname check if command avaialble

alias todo="commands" make alias

Vous aimerez peut-être aussi