intro to linux examples - university of birmingham · tar -cvpf ~/newfile.tar ~/testdir . page 12...
TRANSCRIPT
![Page 1: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/1.jpg)
Page 1 of 12
Intro to Linux Examples
Command What it means Example Results
ls Displays a list of files within the current directory
ls
mkdir Make directory mkdir unixfiles
pwd Present working directory
pwd
![Page 2: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/2.jpg)
Page 2 of 12
cd Change directory cd unixfiles
rm (remove file) or rmdir (remove directory)
Remove directory rm file3 rmdir unixfiles
cp Copy a file cp file1 file2 (this will make a copy of file1 and place it in the current directory with the name file2)
![Page 3: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/3.jpg)
Page 3 of 12
mv Move a file mv file1 file2 (this will rename file1 to file2)
touch touch creates new, empty files
touch file3
![Page 4: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/4.jpg)
Page 4 of 12
less less writes the contents of a file to the screen a page at a time
less linuxintro.txt type q to exit
![Page 5: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/5.jpg)
Page 5 of 12
head head writes the first ten lines of the file to the screen
head linuxintro.txt
![Page 6: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/6.jpg)
Page 6 of 12
tail tail writes the last ten lines of the file to the screen
tail linuxintro.txt
![Page 7: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/7.jpg)
Page 7 of 12
grep grep (global regular expression print) searches input files for specific words or patterns and print the results
grep “research” linuxintro.txt
![Page 8: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/8.jpg)
Page 8 of 12
diff diff shows the difference between to files
diff /etc/nsswitch.conf ~/nsswitch.conf
man man will display the on-line manual which explains the options associated with the command
man sort
![Page 9: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/9.jpg)
Page 9 of 12
![Page 10: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/10.jpg)
Page 10 of 12
ln -s Link creates a soft link or shortcut
ln –s /home/user1/myfile/tmp/link_to_myfile
![Page 11: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/11.jpg)
Page 11 of 12
tar (traditionally tape archive)
Groups a set of files together into a single file. Similar to zipping a file
tar -cvpf ~/newfile.tar ~/testdir
![Page 12: Intro to Linux Examples - University of Birmingham · tar -cvpf ~/newfile.tar ~/testdir . Page 12 of 12 gzip or bzip2 These are often used to compress files gzip -9 ~/newfile.tar](https://reader034.vdocuments.mx/reader034/viewer/2022052019/6032a2c754a01456fb124493/html5/thumbnails/12.jpg)
Page 12 of 12
gzip or bzip2 These are often used to compress files
gzip -9 ~/newfile.tar