For each question, find the correct unix command that will get the exact result
Sample Question: List all files that end with cppls *.cpp
Sample Question: Count the number of files that end with .hls -1 *.h | wc -l
- Get the manual for
ls
- Search the manual page names and descriptions for anything containing
git
- What happens when you type
l
followed byTAB
TAB
- Print the name of the current working directory
- After you execute
ls -al .bash_profile
, what is the shortcut to repeat the same command - After you execute
ls -al .bash_profile
, how do you execute a modified version editing the line - Machine name (something like
csslab1.uwb.edu
) - Command to get the IP address
- Find the IP address (or addresses) for
google.com
- The Operating System
- Number of processes that are currently running on the machine
- The process that is using the largest percentage of memory
- The process that is using the least amount of CPU
- The list of processes without the header line (start from 2nd line)
- Keyboard input to stop running the command
python -c 'while True: 1*1'
- Run
python -c 'while True: 1*1'
in the background. Find all running processes that have the word python in them - Find all running processes that have the word python AND while in them
- Find and terminate the process that has the word python AND while in it
- Your username
- What groups do you belong to
- What shell are you using
- Create an empty file named
funny
- Print a long listing of the file
funny
, so you can see its permissions - Make
funny
to be read-write-executable by you, read-executable by group and readable by everybody - Add the command
ls -al /
as the first line offunny
(without using an editor) - Execute
funny
- Add the command
sleep 10
as the second line offunny
(without using an editor) - Copy
funny
tonot-so-funny
AND preserve its permissions - Make
not-so-funny
to be executable by everybody, but not readable or writeable by everybody (user and group permissions should stay the same) - Make
not-so-funny
to be executable by user, group and everybody, but no read or write permissions to user group or everybody, and then deletenot-so-funny
without getting a confirmation prompt - Use scp to copy funny to
/tmp
incsslab9.uwb.edu machine
with the new namefunny-XXX
where XXX is your username - List all files in
/tmp
in csslab9.uwb.edu, using ssh but without logging in to csslab9. The default shell, usually bash, should not be executed, but of course you have to make a connection to the machine and execute ls on that machine. - Execute
/tmp/funny-XXX
oncsslab9.uwb.edu
, use ssh but do not login to csslab9, XXX is your username - Count how many files there are in
/usr/bin
that has the wordzip
in them - List all files in
/usr/bin
that has the wordyum
in it using find - Make a directory called
yummies
- Copy all files in /usr/bin that has the word
yum
in it into the directoryyummies
- Create a zip file,
my-yummies.zip
, that includes the directory yummies - Create a compressed tar file,
my-yummies.tar.gz
, that includes the directory yummies - Append
my-yummies.zip
tobig-file
3 times - Check the file size of
big-file
in a human readable format - You want to download the
.nanorc
file at https://gist.github.com/jclosure/63820f48cb6551a43a0b272c3542389f The raw file URL is https://gist.githubusercontent.com/jclosure/63820f48cb6551a43a0b272c3542389f/raw/093eff95fcfc6c3c547d9854ebb9a027bb285558/.nanorc Use wget do download it - Use
git
to clonehttps://github.com/pisan343/hello
- Change into the directory hello and execute
simplecompile.sh
in that directory - Fix main.cpp and if necessary
simplecompile.sh
so you do not get any memory leak warnings or style warnings. Usenano
as your text editor - Print
main.cpp
on the standard output - Display
main.cpp
in the standard output waiting for a key at the end of each page and with the ability to go back pages - Display the time it takes to execute
sleep 1
in terms of total time elapsed and the time consumed by system overhead - The full path for the executable for
ls
located - (Not a unix command) Why is https://xkcd.com/149/ funny?
If you need some extra help, try some of the commands below
CTRL-a CTRL-b CTRL-c CTRL-e CTRL-f apropos awk cat cd chmod cp dig du echo find git grep groups hostname kill less ls man mkdir more nslookup ps rm scp sleep ssh tar time touch uname wc wget which whoami zip