Shell Script Commands List
Shell Script Commands List
cat > <filename> : create and insert text into the new filename
ctrl-d : exit from file
cat <filename> : show the content of the filename
cat < <filename> : take the content from the filename and show it on the screen
cat <filename1> <filename2> > <filename3> : merge the contents of filename1 and
filename2 into filename3
cat >> $<variable> : append the user input into the variable
apt-get install <modulename> : get the modulename and install it into the system
cat /etc/passwd : show the content of user password and other related information
chmod <permission number> <filename> -R : change the permission mode for the
filename recursively
chmod <permission number> <directoryfilename> -R : change the permission mode for
the directoryfilename recursively including all its subfolders
chmod <permission number> <directoryfilename> -r : change the permission mode for
the directoryfilename recursively under the directoryfilename but not all of its
subfolders
* drwxrwxrwx
* <directory><owner><group<others/all users>
* <directory><(read)(write)(execute)><(read)(write)(execute)><(read)(write)
(execute)>
* <directory><(4)+(2)+(1)><(4)+(2)+(1)><(4)+(2)+(1)>
* <directory><7><7><7>
find -name <extension> : find the list of files that ends with extension
find -name <extension> -type d : find list of directories that ends with extension
apt-get install tree : install Linux tree module into Linux machine
tree : list the tree file diagram for the Linux file system
apt-get install htop : install Linux htop module into Linux machine
apt-get install sysvbanner : install the Linux sysvbanner module into local machine
apt-get install ncompress : install Linux ncompress module into the machine
uncompress <filename.Z> : uncompress the filename.Z into filename with its original
size and contents
echo "<text1> \r<text2>" : consider text1 as rubbish, useless, only print text2
echo "<text1> \t<text2>" : print text1, tab and print text2
echo "<text1> \n<text2>" : print text1, make new line and print text2
echo "<text1> \b<text2>" : print text1, do backspace and print text2
for item in * : search all files in Linux current path working directory
-i : case insensitive
-n : show the line number
-c : count
-v <text> <textfile> : show the line in textfile that do not match the text
grep ^'<text>' <textfile> : show text that is at the start of the lines in the
textfile
grep '<text>'^ <textfile> : show text that is at the end of the lines in the
textfile
grep $'<text>' <textfile> : search word that starts with the text in the textfile
grep $'<text>' <textfile> : search word that ends with the text in the textfile
grep 'th..' <textfile> : search for word that have th and any two more other
characters on it in the textfile
cat /etc/passwd : show the password storage contents in the Linux system
* <username>:<password>:<userid>:<commentsfield>:<homefolder>:<defaultshell>
man <command> >> <filename> : store the manual for command into filename