Podcast
Questions and Answers
In the Linux command line, what is the purpose of the tty
command?
In the Linux command line, what is the purpose of the tty
command?
- To print the file system name.
- To display the current date and time.
- To print the file name of the terminal connected to standard input. (correct)
- To list all users currently logged in.
What information does the w
command provide?
What information does the w
command provide?
- The current date and time, formatted in UTC.
- The amount of free disk space on the system.
- A summary of system uptime, logged-in users, and load averages. (correct)
- A list of all files and directories in the current directory.
What is the function of the cal
command in Linux?
What is the function of the cal
command in Linux?
- To change file permissions.
- To display a calendar for a specified month or year. (correct)
- To calculate mathematical expressions.
- To set system-wide environment variables.
What does the command date '+%Y'
output?
What does the command date '+%Y'
output?
What is the purpose of the pwd
command?
What is the purpose of the pwd
command?
What does the command ls
do in the Linux file system?
What does the command ls
do in the Linux file system?
What is the effect of the ls -a
command?
What is the effect of the ls -a
command?
What does the output drwxr-xr-x
at the beginning of a line in ls -l
command indicate about a file?
What does the output drwxr-xr-x
at the beginning of a line in ls -l
command indicate about a file?
Which command is used to change the current directory in the Linux command line?
Which command is used to change the current directory in the Linux command line?
Which command is used to remove a directory in Linux?
Which command is used to remove a directory in Linux?
If rm
command cannot remove a directory, what can you infer?
If rm
command cannot remove a directory, what can you infer?
What command creates an empty file?
What command creates an empty file?
What does the command cat test12.txt
do?
What does the command cat test12.txt
do?
What does echo "Hello">test12.txt
accomplish?
What does echo "Hello">test12.txt
accomplish?
What is the difference between >
and >>
when redirecting output?
What is the difference between >
and >>
when redirecting output?
After running the commands echo "Hello">test12.txt
and then echo "World">>test12.txt
, what will be the content of test12.txt
?
After running the commands echo "Hello">test12.txt
and then echo "World">>test12.txt
, what will be the content of test12.txt
?
Which command displays the users currently logged into the system?
Which command displays the users currently logged into the system?
What time zone does EET stand for?
What time zone does EET stand for?
Which one of the following commands will output the current hour, minutes, and seconds?
Which one of the following commands will output the current hour, minutes, and seconds?
Flashcards
What is the tty
command?
What is the tty
command?
Displays your current terminal name.
What is the who
command?
What is the who
command?
Shows who is logged on to the system.
What is the users
command?
What is the users
command?
Displays currently logged in users.
What is the date
command?
What is the date
command?
Signup and view all the flashcards
What is the pwd
command?
What is the pwd
command?
Signup and view all the flashcards
What is the ls
command?
What is the ls
command?
Signup and view all the flashcards
What is the ls -a
command?
What is the ls -a
command?
Signup and view all the flashcards
What is the ls -l
command?
What is the ls -l
command?
Signup and view all the flashcards
What is the cd
command?
What is the cd
command?
Signup and view all the flashcards
What is the mkdir
command?
What is the mkdir
command?
Signup and view all the flashcards
What is the rmdir
command?
What is the rmdir
command?
Signup and view all the flashcards
What is the touch
command?
What is the touch
command?
Signup and view all the flashcards
What is the cat
command?
What is the cat
command?
Signup and view all the flashcards
What does echo 'text' >> file
do?
What does echo 'text' >> file
do?
Signup and view all the flashcards
What does echo 'text' > file
do?
What does echo 'text' > file
do?
Signup and view all the flashcards
What does the cal
command do?
What does the cal
command do?
Signup and view all the flashcards
Study Notes
Basic Terminal Commands and Information
tty
displays the terminal name. In this case, it shows/dev/pts/0
.who
displays who is logged in.users
displays the users currently logged in.w
displays information about the users logged in, including uptime, user, tty, from, login time, idle time, JCPU, PCPU and what the user is doing.date
displays the current date and time.date '+%y'
displays the current year in two-digit format. Result shows25
.date '+%Y'
displays the current year in four-digit format. Result shows2025
.cal
displays the calendar of the current month.
Navigating the File System
cal 4 24
displays the calendar for April 2024.date +%H:%M:%S
displays the current time in HH:MM:SS format, with a result of01:25:58
.pwd
displays the present working directory, which is/home/dina
.ls
lists the files and directories in the current directory.ls -a
lists all files and directories, including hidden ones (those starting with a.
). shows an error due to a space afterls
.- Navigating to the Desktop directory using
cd Desktop
.
File and Directory Permissions
- The output of
ls -l
shows detailed information about files and directories, including permissions, number of links, owner, group, size, and modification date. total 48
indicates the total disk usage of the directory.- Permissions are displayed as a string (e.g.,
drwxr-xr-x
). - The initial
d
indicates a directory;-
indicates a file. - The letters that follow represent permissions:
r
for read,w
for write, andx
for execute (or search, for directories). - The permissions are shown for the owner, group, and others, in that order.
File and Directory Manipulations
ls gr*
lists files starting with "gr".ls te*.txt
lists files starting with "te" and ending with ".txt".- Create directories using
mkdir
. - Remove empty directories using
rmdir
. - Remove files using
rm
.
Redirection and Piping
echo "Hello">test12.txt
overwrites the filetest12.txt
with the word "Hello".echo "World">>test12.txt
appends the word "World" to the end of the filetest12.txt
.cat test12.txt
displays the contents of the filetest12.txt
.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.