Jump to content

Hey there guys, so my Operating Systems teacher, which only focus on Unix based systems, is currently "trying" to teach us how to use properly the Linux command line, but hes not good at helping or explaining things, since what he tells in his own lessons, has little to nothing to do with what his style sheet contains... So just by accident, i found that he was translating into portuguese, several style sheets from a Linux Lesson website. I tought at first how it was so funny that he told us he wasted several hours making these style sheets by himself, where he simply translated into Portuguese these English web based pratical work + lessons. Sadly, no solutions in the website are provided and since i was trying to do the answers, im pasting below the questions from today, in the class and i couldnt do some of them (using Putty trough a web based server, so i guess permissions are at lowest and +50% of commands shouldnt work properly), but even so, can you try and give me the asnwers to my unanswered questions? As best as you can. Thank you, if you can help.

 

 

  • Archive the contents of your home directory using tar. Compress the tar file with gzip. Now uncompress and unarchive the .tar.gz file using cat, tar and gzip on one command line. 
  • Use find to compile a list of all directories in the system, redirecting the output so that the list of directories ends up in a file called directories.txt and the list of error messages ends up in a file called errors.txt.
  • Use ps, w and top to show all processes that are executing.
  • Use ps -aeH to display the process hierarchy. Look for the init process. See if you can identify important system daemons. Can you also identify your shell and its subprocesses?
  • Combine ps -fae with grep to show all processes that you are executing, with the exception of the ps -fae and grep commands.
  • Multiple jobs can be issued from the same command line using the operators ;, && and ||. Try combining the commands cat nonexistent and echo hello using each of these operators. Reverse the order of the commands and try again. What are the rules about when the commands will be executed?
  • What does the xargs command do? Can you combine it with find and grep to find yet another way of searching all files in the /home subdirectory tree for the word hello?
  • What does the cut command do? Can you use it together with w to produce a list of login names and CPU times corresponding to each active process? Can you now (all on the same command line) use sort and head or tail to find the user whose process is using the most CPU?

Groomlake Authority

Link to comment
https://linustechtips.com/topic/580405-operating-systems-lessons/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×