Linux/Unix Command Line Quiz
Test your knowledge of Linux/Unix command-line operations including file management, directory navigation, permissions, system files, and the vi editor.
Questions
What does the pwd command do?
- It changes the password of user
- It shows the current path where the user is
- It shows the passwd file
- It shows information about Linux architecture
What is the use of touch command?
- It makes a new empty file
- It displays the contents of a file
- It updates the pre existing file
- It makes a new directory
The user's current path is /root/Desktop/abc. If he runs $ cd ../../../ what will be the user's HIS current path?
- /
- /root/
- /root/Desktop
- /root/Desktop/abc
From where can the passwd file be accessed?
- /usr/bin
- /etc/passwd
- /sbin/passwd
- /root/Desktop
What is the correct syntax of 'find the passwd file'?
- Find-name /etc
- Find/-name passwd
- Find -uid root -gid root -name passwd
- Find passwd
If umask is 0022, what is the by default permission of a file?
- 644
- 655
- 666
- 777
What is the name of the file where groups are added?
- /etc/grp
- /etc/groups
- /etc/group
- /usr/bin/group
What is the correct format to open the file /etc/test into the vi editor?
- /etc/test vi
- vi /etc/test
- edit /etc/test
- None of these
Which of the following options delete a current line in vi editor?
- Del
- Dd
- DD
- Delete
Which of the following syntax creates a softlink?
- $ ln -s /etc/test test
- $ ln -softlink /etc/test test
- $ ln /etc/test test
- $ ln -slink /etc/test test
What does the head command do?
- It shows the first 20 lines
- It shows the first 10 lines
- It shows the first 50 lines
- It shows the first 5 lines
Command for custom oriented output on PS command is?
- ps -o
- ps -l
- ps -c
- ps -u
Command for creating and displaying short files?
- cat
- chmod
- cd
- cp
Command for Changing permision.
- cat
- chmod
- cd
- cp
Command for changing directory?
- mv
- cp
- more
- cd
Command for copying files?
- ls
- cd
- mv
- cp
Command for display date?
- echo
- date
- head
- grep
Command to connect to a remote machine to download or upload files?
- ftp
- print
- more
- wc
Command for display first part of file?
- tail
- tar
- head
- telnet
Command to create a new directory.?
- mode
- lh
- md
- more