Shared Flashcard Set

Details

Linux
list of basic Linux commands
81
Computer Science
Professional
06/26/2007

Additional Computer Science Flashcards

 


 

Cards

Term
What is this command? ls -F
Definition
lists files and appends an indicator to show if they are files, links, or directories

for example:
etc/ newreadme@ readme
Term
What is this command? cat
Definition
displays the contents of a file
Term
How do you display the contents of the file readme.txt?
Definition
cat readme.txt
Term
What is this command? tail
Definition
output the last part of a file
Term
how do I show the last few lines of the file readme.txt?
Definition
tail readme.txt
Term
What is this command? clear
Definition
clears the terminal screen
Term
What is this command? reset
Definition
resets your terminal to use default terminal settings
Term
What is this command? finger
Definition
displays information on system users
Term
What is this command? who
Definition
displays currently logged in users
Term
What is this command? whoami
Definition
displays your login name
Term
What is id?
Definition
ID associated with your user account name and group names
Term
What is this command? date
Definition
displays the current date and time
Term
What is this command? cal
Definition
displays the calendar for the current month
Term
What is this command? exit
Definition
exits out of your current shell
Term
how can I get help on the whoami command?
Definition
man whoami
Term
What is this command? apropos
Definition
used to search help manual pages
Term
how do I get the info page on the whoami command?
Definition
info whoami
Term
how can I get help on the echo command if there is no man page nor info page?
Definition
help echo
Term
what command can I use to shutdown or restart Linux?
Definition
shutdown
Term
How can I halt the system in 15 minutes?
Definition
shutdown -h +15
Term
how can I cancel a shutdown command?
Definition
log in as another user and type shutdown -c (for cancel)
Term
how can I shutdown now?
Definition
shutdown -h now
Term
how can I reboot now?
Definition
shutdown -r now
Term
in the shutdown command, what is -h and -r?
Definition
-h to halt, -r to reboot
Term
how can I shutdown in 20 minutes with the message "shutting down in 20 minutes for system maintenance"
Definition
shutdown -h +20 Shutting down in 20 minutes for system maintenance
Term
what command allows you to make a disk part of the directory tree
Definition
mount
Term
where are removable devices often located?
Definition
/mnt folder
Term
If you are user bob, what is your default location when you log in?
Definition
/home/bob
Term
what command can you use to see what folder you are in currently?
Definition
pwd
Term
If you log in as root, what is your default home folder?
Definition
/root
Term
how do I change directories to the ron folder under the home folder?
Definition
cd /home/ron
Term
what commands return you to your home directory?
Definition
cd (without any arguments) or cd ~
Term
what command will change you to the root folder?
Definition
cd /
Term
what is an absolute pathname
Definition
the path to a folder starting from the / root
Term
what is a relative pathname
Definition
the path to a folder starting from the current folder
Term
what command changes you to your parent's folder
Definition
cd .. (with spaces between cd and ..)
Term
what command changes directory to the bob folder located under your parent folder?
Definition
cd ../bob
Term
what command changes you to the parent directory of your parent directory?
Definition
cd ../..
Term
using tab completion how do you change to the /home folder?
Definition
cd /h and then press the tab key
Term
which command lists files in the current folder?
Definition
ls
Term
which command lists files in the /home/ron folder?
Definition
ls /home/ron
Term
what other command can you use instead of the ls command?
Definition
dir
Term
how does the ls -F command identify a directory
Definition
it appends / after the name of the directory
Term
how does the ls -F command identify a linked file
Definition
it appends @ after the file name
Term
how does the ls -F command identify an executable file?
Definition
it appends a * after the filename
Term
how do you list files with additional information to go with the names displayed?
Definition
ls -l
Term
how does the ls -l command identify a directory
Definition
d is the first character displayed
Term
how does ls -l identify a linked file
Definition
l is the first character displayed
Term
how does ls -l identify an executable file?
Definition
the permissions will have an x such as rwx-rwx-rwx
Term
how does ls -l identify an ordinary file?
Definition
- is the first character displayed
Term
what is another command you can use instead of ls -l
Definition
ll
Term
what command is used to get information about a file or directory?
Definition
file
Term
how can you use the file command to tell you what each file in the current folder is?
Definition
file *
Term
what command shows hidden files?
Definition
ls -a
Term
what command lists hidden files and also their filetypes
Definition
ls -aF
Term
how can you list files beginning with un
Definition
ls un*
Term
how can you display files that start with u and end with e
Definition
ls u*e
Term
how can you list files that start with un and ends with me and does not care what the third position is?
Definition
ls un?me
Term
how can you display files that start with una and end with e but the four position must have an (e,g,m, or z)?
Definition
ls una[egmz]e
Term
what command lists files that start with una and end with e but the fourth position is not a letter from l to n?
Definition
ls una[!l-n]e
Term
how can I view the contents of the file readme?
Definition
cat readme
Term
how can I view the contents of the readme file and display each line number?
Definition
cat -n readme
Term
how can I view the contents of the file readme but in reverse order?
Definition
tac readme
Term
how can I display only the beginning of the file readme.txt?
Definition
head readme.txt
Term
how can I view the end of the file log.txt
Definition
tail log.txt
Term
how can I view the last 8 lines of the file log.txt
Definition
tail +8 log.txt
Term
how can I view the contents of a file called readme but stop one page at a time?
Definition
more readme
Term
when you use the more command, how do you display the next line?
Definition
press enter key
Term
when using the more command, how do you display the next page
Definition
press spacebar key
Term
what command is similar to the more command but is newer and with more features?
Definition
less
Term
how can I view the files of the current directory but stop the screen one page at a time?
Definition
ls | less or ls | more
Term
can you use the commands cat, tac, head, and tail on binary files?
Definition
No, they should only be used on text files
Term
what command allows you to view the string portion of a binary file?
Definition
strings
Term
how can you view the text portion of the echo command located in the /bin folder?
Definition
strings /bin/echo
Term
what command can you use to view a binary file in octal format?
Definition
od
Term
what command can you use to search files for lines that match a given pattern?
Definition
grep
Term
what command will return all the lines with "hello" in the file readme.txt?
Definition
grep "hello" readme.txt
Term
what command will return all lines in the file readme.txt with hello regardless of case?
Definition
grep -i "hello" readme.txt
Term
what command will return lines with words starting with w and ending with e in the file readme?
Definition
grep "w...e" readme
Term
what command returns lines with words beginning with "I" in the file readme.txt?
Definition
grep "^I" readme.txt
Term
what command returns lines containing we or us in the file log.ini?
Definition
egrep "(we|us)" log.ini
Supporting users have an ad free experience!