Commands Flashcards

1-8

1
Q

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?

A

tar -cvf /home.tar /home

tar -tvf /home

tar -xvf /home.tar -C /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do I see the ip address of a system?

A

ipaddr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do I create an empty file?

How do I edit an existing one?

A

touch

vi /home/text.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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–

A

chmod 774 /home/file.txt

chmod u+x,g+w,o-x+r /home/file.txt

Big S, because execute isn’t enabled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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?

A

blkid

dmidecode -t

shch

uname -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

cd /etc/inittab

cd /etc/rc5.d, ls

ls -l /etc/rc5.d/*sshd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do I add the user rob and give him a directory?

A

useradd -d /home/Rob -m Rob

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do I determine the file type?

A

file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Create a symbolic link to /share/allnotes.txt called /tmp/notes.sym.

A

ln -s /share/allnotes.txt /tmp/notes.sym

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do I locate files and directories at the beginning of the file system ending with .txt?

A

find / -name *.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do I forcefully remove a user and there directory?

A

userdel -rf Rob

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Print all lines matching the pattern string “student” from within the /etc/passwd file.

A

grep student /etc/passwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Remove user’s jobs identified by job number.

A

Atrm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Create the nested directories /media/music/pop.

A

mkdir -p /media/music/pop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly