Jump to content

Linux terminal command questions


still learning

Recommended Posts

Ok, I am new to Linux and am useing Ubuntu Jaunty 9.04.

I would like to learn how to use the CLI better.. can anyone help me out with what the command is to do these tasks? quick linux quiz!

- How do I view the user list of created user accounts and passwords on my system.. I know i can type "who" to see whos on my pc at that moment, but would like to see all the user accounts listed.

- what is the password. file for? user accounts on my linux pc? where is it ussually located?

- what exactly is the cat command good for? i have googled and get mixed stuff

- how do i empty my temporary files, or clean the cache (stuff simular to useing ccleaner in windows)

- how do i update chkrootkit? i know since i installed it 2 weeks ago their has to be a way to update it right? simular to AVG or Avast antovirus updates? or even Clam AV, is that worth installing? and after installed how do i update stuff from the terminal screen, sudo apt-get update "program"?

Im positive just by these questions you can tell im new to linux from windows, any help is appriciated. Thanks

Link to comment
Share on other sites

Ok, I am new to Linux and am useing Ubuntu Jaunty 9.04.

I would like to learn how to use the CLI better.. can anyone help me out with what the command is to do these tasks? quick linux quiz!

- How do I view the user list of created user accounts and passwords on my system.. I know i can type "who" to see whos on my pc at that moment, but would like to see all the user accounts listed.

- what is the password. file for? user accounts on my linux pc? where is it ussually located?

- what exactly is the cat command good for? i have googled and get mixed stuff

- how do i empty my temporary files, or clean the cache (stuff simular to useing ccleaner in windows)

- how do i update chkrootkit? i know since i installed it 2 weeks ago their has to be a way to update it right? simular to AVG or Avast antovirus updates? or even Clam AV, is that worth installing? and after installed how do i update stuff from the terminal screen, sudo apt-get update "program"?

Im positive just by these questions you can tell im new to linux from windows, any help is appriciated. Thanks

Sounds like somebody's homework

Link to comment
Share on other sites

- How do I view the user list of created user accounts and passwords on my system.. I know i can type "who" to see whos on my pc at that moment, but would like to see all the user accounts listed.

- what is the password. file for? user accounts on my linux pc? where is it ussually located?

- what exactly is the cat command good for? i have googled and get mixed stuff

- how do i empty my temporary files, or clean the cache (stuff simular to useing ccleaner in windows)

-Try command cat /etc/passwd |grep /home

-The password file? Try command locate shadow. I'll assume you mean the /etc/shadow file. Contains all users and hashed passwords, think SAM file in windows.

-Try command man cat. concatenation, and viewing files. ie: cat /etc/passwd

- Try command rm -R /tmp/*

when starting out with Linux, I've found that Google is your best friend, far quicker and better answers then a forum. also check out the book Linux Pocket Guide.

Link to comment
Share on other sites

- how do i update chkrootkit? i know since i installed it 2 weeks ago their has to be a way to update it right? simular to AVG or Avast antovirus updates? or even Clam AV, is that worth installing? and after installed how do i update stuff from the terminal screen, sudo apt-get update "program"?

Not worth installing the very, very few viruses out there for Linux are aimed at the server side of things, and are virtually non-existent for the Linux desktop.

Programs are automatically updates though the Update Manager, assuming they are in the Ubuntu repositories or you added a repository for that program, System-->Admin-->Update Manager (Basically if you installed it via apt-get or aptitude then it will automatically update).

If you want to update it from the command line, then you should type "sudo apt-get update" (note this updates apt-get not the program itself) and then "sudo apt-get install [program name]" (basically re-installing the program)

Link to comment
Share on other sites

Thanks everyone, is it normal to have a user named "Nobody" on your passwd file? sounds suspicious.. how can i delete that account?

Im guessing sudo gedit /ect/passwd? then just delete the name line in gedit and save? or is there a better way? so the cat command is the same as useing the | command in the string? thanks for all your help! :)

Link to comment
Share on other sites

Thanks everyone, is it normal to have a user named "Nobody" on your passwd file? sounds suspicious.. how can i delete that account?

Im guessing sudo gedit /ect/passwd? then just delete the name line in gedit and save? or is there a better way? so the cat command is the same as useing the | command in the string? thanks for all your help! :)

nobody is generic default *nix users. leave it alone.

no the cat command is nothing like using a | (pipe command). Pipe does what it sounds like it should do, pipes the output of one command into another.

Link to comment
Share on other sites

About ClamAV and other Linux anti-virus/trojan/rootkit/whatevs...

If you dual boot your comp with Linux and Windows, those tools are very handy...not so much for the Linux side (as others mentioned above, not much Linux malware exists), but for scanning your Win partition for viruses that might have root kitted themselves or otherwise tricked/corrupted your Windows AV program into not detecting or eliminating it.

After my gf's Windows-only laptop got ate up real bad with Conficker and nothing could remove it, I reinstalled XP and then installed Ubuntu. I didn't hold out much hope she'd switch over to using Linux (she likes the idea of how secure it is, but is too stubborn/lazy to learn a new OS :lol: ), I put it there for the next time some piece of super-malware decides to eat the Windows side of her computer.

Link to comment
Share on other sites

About ClamAV and other Linux anti-virus/trojan/rootkit/whatevs...

If you dual boot your comp with Linux and Windows, those tools are very handy...not so much for the Linux side (as others mentioned above, not much Linux malware exists), but for scanning your Win partition for viruses that might have root kitted themselves or otherwise tricked/corrupted your Windows AV program into not detecting or eliminating it.

After my gf's Windows-only laptop got ate up real bad with Conficker and nothing could remove it, I reinstalled XP and then installed Ubuntu. I didn't hold out much hope she'd switch over to using Linux (she likes the idea of how secure it is, but is too stubborn/lazy to learn a new OS :lol: ), I put it there for the next time some piece of super-malware decides to eat the Windows side of her computer.

I recently did a full install (non-dual boot) of Ubuntu 8.04 for my gf on her laptop. She's sat there watching me troubleshoot things and install cool programs enough that she's now surpassing my expectations. She installed some photo program that you can sort and edit photos in 3D live. Sure she didn't build it from source, but the fact that she found something she liked and got it working is pretty amazing.

Her ubuntu interface is all tricked out now, very girly, but then again, she's a girl.

She loves Linux now, and I couldn't be more proud.

Link to comment
Share on other sites

I recently did a full install (non-dual boot) of Ubuntu 8.04 for my gf on her laptop. She's sat there watching me troubleshoot things and install cool programs enough that she's now surpassing my expectations. She installed some photo program that you can sort and edit photos in 3D live. Sure she didn't build it from source, but the fact that she found something she liked and got it working is pretty amazing.

Her ubuntu interface is all tricked out now, very girly, but then again, she's a girl.

She loves Linux now, and I couldn't be more proud.

Just install auto-apt for her and she will be compiling from source in no time. Its not the best way but its fast if you have no idea.

auto-apt run ./configure

make

make install

Link to comment
Share on other sites

Just install auto-apt for her and she will be compiling from source in no time. Its not the best way but its fast if you have no idea.

auto-apt run ./configure

make

make install

We totally just hi-jacked this thread, but oh well..

I have her in terminal doing the usual sudo apt-get install's. She actually prefers the terminal than the package manager GUI.

I'm not sure what auto-apt is, but you bet i will be googleing it here in a sec :)

Thanks for the tip!

Link to comment
Share on other sites

You got yourself a keeper, miT :lol:

You don't have to tell me twice!

Thanks for the compliment ;) I like teaching her about Ubuntu as well as others on our IRC network. Almost 85% of our users have switched to linux (of all variants). We like to swap tips and help troubleshoot each others setups. It's quite entertaining and you learn a lot from others.

Link to comment
Share on other sites

About ClamAV and other Linux anti-virus/trojan/rootkit/whatevs...

If you dual boot your comp with Linux and Windows, those tools are very handy...not so much for the Linux side (as others mentioned above, not much Linux malware exists), but for scanning your Win partition for viruses that might have root kitted themselves or otherwise tricked/corrupted your Windows AV program into not detecting or eliminating it.

After my gf's Windows-only laptop got ate up real bad with Conficker and nothing could remove it, I reinstalled XP and then installed Ubuntu. I didn't hold out much hope she'd switch over to using Linux (she likes the idea of how secure it is, but is too stubborn/lazy to learn a new OS :lol: ), I put it there for the next time some piece of super-malware decides to eat the Windows side of her computer.

Clam-AV is also handy for cleaning out crap in your mail that you got from that aunt that spams the whole damn family. Sure it's not going to do anything to your machine, but every now and then a diamond will come in that you want to pass along to a couple friends. You don't want to be "that guy" that sent a virus/trojan in an email.

Link to comment
Share on other sites

Nine times out of ten, cat is useless. About the only use for it is to type files to terminal, and that's really just a side effect of it's intended purpose. Cat was made to concatenate multiple files to its output, but is unnecessary, as most CLI apps that can take input from stdin can process multiple files. ( `awk -f script.awk file1 file2 file2` vs `cat file1 file2 file3 | awk -f script.awk` and `wc < file` vs `cat file | wc`)

Temporary files in /tmp/ should be removed on boot. Other than that, dilligence. Know where programs are putting their temp files.

You should also learn vi(m). If you have vim installed, run vimtutor and it will copy a tutorial to /tmp/ and then just read and do the examples. You should at least get a basic understanding of vi (not just using it in insert mode all the time.) If vi isn't to your liking, try emacs too, but you should at least be able to use substitute and search in vi. Emacs will open a window if launched in an Xsession, but to get a gui for vim, you need gvim. I don't recommend nano/pico or gedit as they are very limited.

EDIT: Grammar

Link to comment
Share on other sites

You should also learn vi(m). If you have vim installed, run vimtutor and it will copy a tutorial to /tmp/ and then just read and do the examples. You should at least get a basic understanding of vi (not just using it in insert mode all the time.) If vi isn't to your liking, try emacs too, but you should at least be able to use substitute and search in vi. Emacs will open a window if launched in an Xsession, but to get a gui for vim, you need gvim. I don't recommend nano/pico or gedit as they are very limited.

You see, the person that wrote vi really just got sucked into his computer and had to battle his way out in order to master and defeat the program. It may seem complicated at first, but when you master it you will feel like a black belt in linux-fu. Or maybe not. I don't know. It's still a good thing to learn. I would also recommend getting certification from something like Redhat Academy. good stuff.

Link to comment
Share on other sites

I hate to say it (and yes you can shudder) but I absolutely HATE using vi and/or emacs, or any other linux cli text editor.. Why? Because they are all different in their own different ways with different shortcuts, different this, and different that, and call me old in my ways but to me NOTHING beats the cli notepad from old dos days past....

Link to comment
Share on other sites

I hate to say it (and yes you can shudder) but I absolutely HATE using vi and/or emacs, or any other linux cli text editor.. Why? Because they are all different in their own different ways with different shortcuts, different this, and different that, and call me old in my ways but to me NOTHING beats the cli notepad from old dos days past....

edit ftw =)

o wait.... vi > all

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...