Commands Flashcards
1-8
How do I create an archive of /home?
How do I view an archived file?
How do I extract an archive and leave it in its home directory?
tar -cvf /home.tar /home
tar -tvf /home
tar -xvf /home.tar -C /
How do I see the ip address of a system?
ipaddr
How do I create an empty file?
How do I edit an existing one?
touch
vi /home/text.txt
How do I numerically and symbolically change the permissions of /home/file.txt
drw-r-x–x to full user, full to group, only read to world?
Is the permission set below going to give me a big S or a little one? And why?
drw-rw-r–
drws-rws-r–
chmod 774 /home/file.txt
chmod u+x,g+w,o-x+r /home/file.txt
Big S, because execute isn’t enabled
How do I see the current file system?
How do I see specific system hardware specs like the processor type/speed?
How do I see the current installed shells?
How do I see system version info?
blkid
dmidecode -t
shch
uname -a
How do I see what the default run configuration of a system?
How do I see the service scripts of init 5?
How do I pick out the httpd script in /etc/rc5.d?
cd /etc/inittab
cd /etc/rc5.d, ls
ls -l /etc/rc5.d/*sshd
How do I add the user rob and give him a directory?
useradd -d /home/Rob -m Rob
How do I determine the file type?
file
Create a symbolic link to /share/allnotes.txt called /tmp/notes.sym.
ln -s /share/allnotes.txt /tmp/notes.sym
How do I locate files and directories at the beginning of the file system ending with .txt?
find / -name *.txt
How do I forcefully remove a user and there directory?
userdel -rf Rob
Print all lines matching the pattern string “student” from within the /etc/passwd file.
grep student /etc/passwd
Remove user’s jobs identified by job number.
Atrm
Create the nested directories /media/music/pop.
mkdir -p /media/music/pop