Linux Commands

Embed Size (px)

DESCRIPTION

Linux Commands

Citation preview

pwd- present working directoryls - listnick@ubuntu:~$nick -username~home directory$-Guestcd - change directorycd .. - up(above directory in which it is contained/one level above directory)clear-clearmkdir - make directoryless- list the contents inside text file(can`t edit)q to exit from lesscd / -root directorylocate - search and displays path of filefor locate directory must be updatedsudo updatedb - update databasenano - create or edit filenano createnano hw1.txt edit filesignificance of colors on ubuntu blue= folder or directorylight blue = protected folderwhite = text file^O= ctrl+O (save file-write out)cd /ls -l cp "text file" "folder" -copycp hw1.txt hw1-backup.txtmv hw1txt Homework(folder) - movermdir remove folder(if empty)rm removenano can also run different program code fileschmod change modifiy characterchmod g+wchmod u/g/o(u-user/g-group/o-other) u+w+r+x(write-read-execute)chmod 777 name(2^2,2^1,2^0)to make a filecat > filename(can be used to write contents)If access is denied change permissions chmod 777ctrl+d to exit text editorcat filename =to open filegrep searchword file (search text in file)grep -v hello abcd (hello will not appear in text)grep -c hello abcd(how many times a word appear)cd /devlssudo hexdump -C psauxctrl+c/z = to exit this codesudo apt-get install cmatrixcmatrixfos(free open software)sl(steam locomotive)apt -get install slsl-l(smaller size)sl -a(accident)oneko(tom and jerry)cowsay I love linuxcowsay -f dragon hellohow to print dragon in javacowsay -lesscowsay -f gnu hellofortunefortune | cowsay -f dragon