Stop Microsoft
Operating Systems => Linux and UNIX => Topic started by: H_TeXMeX_H 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):
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.
# /sbin/shutdown -r now
this restarts the computer from the terminal
# /sbin/shutdown -h now
this shuts down the computer from the terminal
$ ps -U $UID
this lists all running processes that you have started
$ kill -TERM ####
here #### is a process id number, this terminates a process; use in combination with ps -U $UID
$ cat file1 file2 file3 ... fileN > concatenatedfile
the easiest way to join files.
$ 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 (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
-
Wow. You didn't know any of those?
:eek:
-
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.
-
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.
-
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
-
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.
-
is there a single manual where they can be found ? or a few ?
-
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.
-
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
-
ah you gave me and toadlife the impression that you had just discovered them :D
-
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.
-
Advanced Bash-Scripting Guide (http://www.tldp.org/LDP/abs/html/index.html)
useful in Linux administration
-
$ 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?
-
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.
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.
-
I haven't tried it on UNIX but that's certainly the case for DOS which stole piping from UNIX, so I agree.
-
I've just tried it now, you're right.
alun@cpc2-bedn1-0-0-cust299:~$ echo Hello World >myfile.txt
alun@cpc2-bedn1-0-0-cust299:~$ ls
CD4050BC.pdf Desktop dosemu myfile.txt OperaDownloads results
alun@cpc2-bedn1-0-0-cust299:~$ cat myfile.txt
Hello World
alun@cpc2-bedn1-0-0-cust299:~$ echo Hello World >myfile.txt
alun@cpc2-bedn1-0-0-cust299:~$ cat myfile.txt
Hello World
alun@cpc2-bedn1-0-0-cust299:~$ echo Hello World >>myfile.txt
alun@cpc2-bedn1-0-0-cust299:~$ cat myfile.txt
Hello World
Hello World
alun@cpc2-bedn1-0-0-cust299:~$