Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Edit: Could you guys verify the answers I come up with?
Here are the questions, thanks in advance.
1- Count how many users are logged in currently. One user counts only once.
2- Count how many users are not using bash as a login shell
3- List all of the users whose login names contain “all” in them.
4- List all the symbolic links’ names in the current directory.
5- Count how many users are celebrating his name day at 6th of December (Santa Claus in Hungarian is Miklos)
6- Remove all files named “Core” and “core” from your home directory.
7- Start the archiving process of your home directory. Suspend the process and put it into the background. How can you get it back to the foreground?
8- Remove the comment from the .bash_rc file and create a new version as .bash_rc.new
9- How can you create a symbolic link?
10- List the content of the actual directory using ctime as sorting key and show only the first four entries.
1) users | wc -l
2) cat /etc/passwd | grep -v \/bin\/bash | wc -l
3) cat /etc/passwd | cut -d ":" -f1 | grep all
4) ls --file-type | grep @ OR find . -xtype l
5) cat /etc/passwd | cut -d ":" -f1 | grep Miklos (I'm not sure)
6) cd ~ && rm [cC]ore OR find ~ -type f | grep -e "[C|c]ore"
7) cd
cd ..
tar -cf homearchive.tar home
ctrl+Z
fg
8) sed '/^\#/d' .bash_rc > .bash_rc.new
9) 9) ln -s [src_file] [link_name]
10) ls -al --sort=time | head -n5 | tail -n4
Last edited by Alican; 05-18-2010 at 06:45 PM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Alican, I thought I was the world's worst student, but I have to say you are very serious competition!
Quote:
Can you guys verify the answers I come up with at least
?
Try them yourself!
Quote:
7) cd (this should go to home directory if no path is given right?)
cd ..
tar -cf homearchive.tar home
cd (on my machine) goes to MY home directory: ie /home/<myusername> NOT /home
cd .. goes to the directory above the present working directory. So if I'm not mistaken:
Quote:
cd
cd ..
tar -cf homearchive.tar home
will only make an archive if you have a directory /home/home, otherwise it will spit out an error message.
But don't take my word for it, I'm at least the world's second worst student, try it out.
Good luck, and thanks for starting one of the funniest threads I've read in a long time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.