Author Topic: Possibly useful commands  (Read 1840 times)

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Possibly useful commands
« on: 2 May 2006, 22:47 »
I've had some trouble doing specific things on Linux in the past because I didn't know some rather important commands that everyone should know. Here are a few of them (I'll list more when I remember them):

Code: [Select]
Ctrl Alt F1 this logs you out bringing you to login: prompt, similar to Ctrl Alt Delete in Window$, but more useful. Do this when a program fails to respond and you have no way of reaching a terminal. It removes the need for hard reset.

Code: [Select]
# /sbin/shutdown -r now this restarts the computer from the terminal

Code: [Select]
# /sbin/shutdown -h now this shuts down the computer from the terminal

Code: [Select]
$ ps -U $UID this lists all running processes that you have started

Code: [Select]
$ kill -TERM #### here #### is a process id number, this terminates a process; use in combination with ps -U $UID

Code: [Select]
$ cat file1 file2 file3 ... fileN > concatenatedfile the easiest way to join files.

Code: [Select]
$ rpm2cpio name.rpm | cpio -id --quiet extracts an rpm

Besides these there are things like cd (change directory), ls (list contents of directory), find -type f (find all files in a directory) find -type d (all directories in a directory), ln (make symbolic links), rm (remove files) rm -r (remove directories), grep (find lines in a file), cp (copy files), mv (move or rename files), chmod (change permissions), chown (change owner), mkdir (make a directory) ...

ok well, that's more involved I suppose, but I can tell you it's real useful when GUI fails :D

Here's a nice guide to bash (you don't have to learn shell scripting, just pick things that may be of use, and if you want to, learning bash is not too hard either)

http://www.linuxcommand.org/learning_the_shell.php

and burning CDs and DVDs from the terminal may come in handy too:

http://yolinux.com/TUTORIALS/LinuxTutorialCDBurn.html

toadlife

  • Member
  • **
  • Posts: 730
  • Kudos: 376
    • http://toadlife.net
Holy crap
« Reply #1 on: 3 May 2006, 04:37 »
Wow. You didn't know any of those?

:eek:
:)

Pathos

  • Member
  • **
  • Posts: 518
  • Kudos: 416
Re: Possibly useful commands
« Reply #2 on: 3 May 2006, 05:05 »
err...

when I first really started getting into linux I went through every file in /bin and /usr/bin with --help and man to work out what they did. I forgot most but learnt all the ones I would need.

It was only Tomsrtbt and DSL but it had all the important ones.

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: Holy crap
« Reply #3 on: 3 May 2006, 18:23 »
Quote from: toadlife
Wow. You didn't know any of those?

:eek:

Well ... no ... It was kinda hard to find them too, mostly by chance. Besides, the documentation I've found isn't too clear anyway. Oh, I forgot to tell you, I hate reading manuals. And where would you find Ctrl Alt F1 ? I found it while trying to install the non-free nvidia drivers manually.

piratePenguin

  • VIP
  • Member
  • ***
  • Posts: 3,027
  • Kudos: 775
    • http://piratepenguin.is-a-geek.com/~declan/
Re: Holy crap
« Reply #4 on: 3 May 2006, 19:07 »
Quote from: H_TeXMeX_H
Well ... no ... It was kinda hard to find them too, mostly by chance. Besides, the documentation I've found isn't too clear anyway. Oh, I forgot to tell you, I hate reading manuals. And where would you find Ctrl Alt F1 ? I found it while trying to install the non-free nvidia drivers manually.
You would find it by understanding virtual terminals and the way X starts ;) (not something I'd expect people to know)

I was reading books bout GNU/Linux and the different commands before I ever installed it. Because I heard it's so hard, I thought I would need it. As it turns out, it's not that hard, but I still need it, because it makes life 100 times easier.

I don't even use a file manager anymore. What a waste of time :P
"What you share with the world is what it keeps of you."
 - Noah And The Whale: Give a little love



a poem by my computer, Macintosh Vigilante
Macintosh amends a damned around the requested typewriter. Macintosh urges a scarce design. Macintosh postulates an autobiography. Macintosh tolls the solo variant. Why does a winter audience delay macintosh? The maker tosses macintosh. Beneath female suffers a double scum. How will a rat cube the heavier cricket? Macintosh calls a method. Can macintosh nest opposite the headache? Macintosh ties the wrong fairy. When can macintosh stem the land gang? Female aborts underneath macintosh. Inside macintosh waffles female. Next to macintosh worries a well.

adiment

  • Global Moderator
  • Member
  • ***
  • Posts: 575
  • Kudos: 519
Re: Possibly useful commands
« Reply #5 on: 4 May 2006, 00:15 »
even I know those ;) and been using Linux for a few weeks, not that new to it though; tried it out for a few months 2 years ago.

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: Possibly useful commands
« Reply #6 on: 4 May 2006, 00:58 »
is there a single manual where they can be found ? or a few ?

Pathos

  • Member
  • **
  • Posts: 518
  • Kudos: 416
Re: Possibly useful commands
« Reply #7 on: 4 May 2006, 02:56 »
usually I have only accidentally bumped into webpages with lists of useful comands/keystrokes.

http://www.google.co.nz/search?q=useful+linux+commands

we just assumed that running fedora core and have almost 900 posts you would be fairly familiar with all of them.

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: Possibly useful commands
« Reply #8 on: 4 May 2006, 03:17 »
Well ... I am now ... but not when I started using Linux. I've learned to program with shell scripts, so I now know pretty much all of them, but it wasn't easy to find them all. I got lucky with shell scripts, I found a web site that hosted a whole book on it ... the web site was taken off, but luckily I saved it as HTML just in case something like that would happen.

Hmmm ... this site looks like it has a ton of them:

http://www.er.uqam.ca/nobel/r10735/unixcomm.html

Pathos

  • Member
  • **
  • Posts: 518
  • Kudos: 416
Re: Possibly useful commands
« Reply #9 on: 4 May 2006, 06:52 »
ah you gave me and toadlife the impression that you had just discovered them :D

toadlife

  • Member
  • **
  • Posts: 730
  • Kudos: 376
    • http://toadlife.net
Re: Holy crap
« Reply #10 on: 4 May 2006, 07:15 »
Quote from: H_TeXMeX_H
Well ... no ... It was kinda hard to find them too, mostly by chance. Besides, the documentation I've found isn't too clear anyway. Oh, I forgot to tell you, I hate reading manuals. And where would you find Ctrl Alt F1 ? I found it while trying to install the non-free nvidia drivers manually.

Well I guess this just shows how out of touch I am with current linux distros.  IN BSD, you don't survive very long without knowing most of those commands.

When you have to set up your X with the old-syle Xorgconfig program and then tweak it manualy afterward and then set up your .xinitrc file by hand just to get your desktop manager to load, you tend to pick up these things quickly.
:)

H_TeXMeX_H

  • Member
  • **
  • Posts: 1,988
  • Kudos: 494
    • http://draconishinobi.50webs.com/
Re: Possibly useful commands
« Reply #11 on: 20 May 2006, 23:09 »
Advanced Bash-Scripting Guide

useful in Linux administration

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Re: Possibly useful commands
« Reply #12 on: 21 May 2006, 17:56 »
Quote
$ cat file1 file2 file3 ... fileN > concatenatedfile
i am probably being really dumb, but shouldn't it be >> rather than > ?

i am under the impression that > wipes the existing contents of the outfile, if it exists, while >> appends the inputs to the outfile. is this wrong?
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

piratePenguin

  • VIP
  • Member
  • ***
  • Posts: 3,027
  • Kudos: 775
    • http://piratepenguin.is-a-geek.com/~declan/
Re: Possibly useful commands
« Reply #13 on: 21 May 2006, 18:08 »
Quote from: Calum
i am probably being really dumb, but shouldn't it be >> rather than > ?
It doesn't need to be >> because 'cat file1 file2...' will concatenate file1 and file 2 to stdout, redirect that to overwrite concatenatedfile with >. You could use >> if you want whatever's already in concatenatedfile to stay.
Quote

i am under the impression that > wipes the existing contents of the outfile, if it exists, while >> appends the inputs to the outfile. is this wrong?
No, correct.
"What you share with the world is what it keeps of you."
 - Noah And The Whale: Give a little love



a poem by my computer, Macintosh Vigilante
Macintosh amends a damned around the requested typewriter. Macintosh urges a scarce design. Macintosh postulates an autobiography. Macintosh tolls the solo variant. Why does a winter audience delay macintosh? The maker tosses macintosh. Beneath female suffers a double scum. How will a rat cube the heavier cricket? Macintosh calls a method. Can macintosh nest opposite the headache? Macintosh ties the wrong fairy. When can macintosh stem the land gang? Female aborts underneath macintosh. Inside macintosh waffles female. Next to macintosh worries a well.

Aloone_Jonez

  • Administrator
  • Member
  • ***
  • Posts: 4,090
  • Kudos: 954
Re: Possibly useful commands
« Reply #14 on: 21 May 2006, 18:24 »
I haven't tried it on UNIX but that's certainly the case for DOS which stole piping from UNIX, so I agree.
This is not a Windows help forum, however please do feel free to sign up and agree or disagree with our views on Microsoft.

Oh and FUCKMicrosoft! :fu: