Skip to content
linuxbeginner

Linux Basics

File operations, permissions and processes

7 questions

By EZ4Code Team

1. What is the command to list files in the current directory?

ls
list
dir
show
Explanation: ls lists directory contents; ls -l shows detailed information; ls -a shows hidden files.

2. What does the file permission rwxr-xr-- mean?

Owner: read/write/execute; group: read/execute; others: read-only
Everyone: read/write/execute
Owner: read-only; others: read/write/execute
Group: read/write/execute; others: read-only
Explanation: Permissions are divided into three groups: owner (rwx), group (r-x), others (r--); r=4, w=2, x=1, so the numeric form is 754.

3. What is the command to change file permissions?

chmod
chown
chperm
perm
Explanation: chmod changes permissions (e.g. chmod 755 file or chmod u+x file); chown changes the owner; chgrp changes the group.

4. What command shows the absolute path of the current directory?

pwd
cwd
path
where
Explanation: pwd (print working directory) prints the absolute path of the current working directory.

5. What is the command to view running processes?

ps or top
ls proc
show proc
list
Explanation: ps aux lists a snapshot of all processes; top dynamically displays processes and resource usage in real time; htop is a friendlier alternative to top.

6. What does the pipe symbol | do?

Passes the output of the previous command as input to the next command
Logical OR
Background execution
Redirect to a file
Explanation: cmd1 | cmd2 connects cmd1's standard output to cmd2's standard input, e.g. ls | grep '.txt' filters lines containing .txt.

7. What is the difference between > and >>?

> overwrites the file; >> appends to the end of the file
They are exactly the same
> appends, >> overwrites
Both are input redirection
Explanation: > file redirects output to a file (overwriting); >> file appends to the end of the file; < is input redirection.