Here's a cheatsheet for various useful console commands. Others have requested it but any answer typically is a link to another site. Feel free to add to it.
changing users from the console
su root -- changes from current user to 'root'. If you're really lazy just type 'su' with nothing else and it defaults to 'root'.
su beeblequix -- changes from current user to 'beeblequix', the super-duper-user. lol.
--does not mean 'super user'
--does mean 'switch user'
su - root --will make it a new login shell, starting a new shell with those new credentials (thx Wells)
how to use a file ending with '.run'
sh xxxxxx.run -- executes a .run file; analogous to the .exe files in Windows only we have to indicate it to be a shell script with 'sh'
./ xxxxxx.run -- same (thx Zak317)
xxxxx -- IF the executable bit is set just type the file (thx jlightner)
From jlightner:
a) Executables in Linux do NOT require extensions. You can call a command:
billybob.run
billybob
billybob.exe
billybob.whythehelldoihaveanextension
billbybob.sh
(.sh by the way is the one most folks use when creating their own shell scripts IF they give it an extension.)
chmod 755 filename -- grants rwx permissions of filename to the owner, and read/execute to group and those not in the group. Useful for ensuring only the owner can alter a file but still let group and those outside the group use the file
chmod 777 filename -- grants read, write and execute permissions to a file for everyone (owner, group, everyone else)
-- root still 0WNS (aka PWNZ) everything....
some hardware listing commands
lspci -X -- lists pci info in X-friendly way (ex. PCI:2:0:0). If you just use 'lspci' it comes out in hex.
lsmod -- useful to see whether your agpgart is running
converting from one package type to debian friendly one
alien -d somecrappyredhatfile.rpm -- converts a .rpm to a .deb file
-- must have alien installed
getting information on a command
man somecommandIwishtoknowmoreabout -- gives you the War & Peace documentation for stated command
info somecommandIwishtoknowmoreabout -- gives you the *edited: War & Peace PLUS Deepthoughts & Insights Volume* on the command. (sometimes info not available) (thx jlightner)
command --help -- the pamphlet on 'command'
manipulating files, navigating around
ls -l -- long listing
ls -l|less -- (that line is a pipe) passes output of ls into 'less'. this allows you to move back & forth in the listing if it scrolls out of view while in a non-X-ical environment (regular command interface)
ls -lrat -- long list of all in reverse order by time (effectively puts the newest files on the bottom)
ls -lat -- long list of all by time (puts the oldest files on the bottom)
cp XF86Config-4 XF86Config-4.backup.before.installing.new.ATI.drivers -- backs up a file from, well, the short one to the long one. Yes, judging from the name of my backup there is a story to tell
mkdir newdirectory -- makes a new directory beneath current one
mv thisfile.file newdirectory -- moves thisfile.file into our new directory
mv thisfile.file ./newdirectory/. -- same thing but more typing
cd newdirectory -- changes directory into the new one
cd .. -- moves up one level
cd ../.. -- moves up two levels
cd -- changes back to /home/youruser directory
cd /home/youruser -- same thing but more typing
rmdir newdirectory -- removes/deletes 'newdirectory'
rm deletethis.txt -- removes/deletes file deletethis.txt
rm -r -- recursive remove. Careful.
rm -rf -- to force and recursively remove a directory and its content (thx Zak317)
Tarballs -- I have a number of files to archive/extract from archive/view the archive:
tar -czvf balloftar.tar file1 file2 -- create a file 'balloftar.tar' from file1 and file2, funnel thru gzip, and do it all verbosely
tar -xzf balloftar.tgz -- extract and send through gunzip the file "balloftar.tgz"
tar -tvf whatisinside.tar -- takes a peek inside the file 'whatisinside.tar' so that you can view the contents of the tarball without having to extract it
-- useful for packaging and archiving a "grundle o' files".
-- also a good way to prepare for ftp these same "grundle o' files".
what's running and how can I stop them
top -- gives a running system display of everything. Uses a bunch of resources though, so unless your system has nothing else to do use it conservatively.
free -- lists your available memory including pagefile (aka swapfile)
df -- display filesystem. Good to keep track of which directories are hogging up all your diskspace.
df -a -- display all filesystems
df -ha -- in HUMAN READABLE format in 1024 #'s
df -Ha -- same but in 1000's
ps -ef -- lists all running processes. Useful to find process id (pid).
ps -ef|grep armyops -- scans all running processes for some dumb process(es) containing the string 'armyops' (that's America's Army for those of you in Rio Linda...)
kill nnnnn -- kills a process with pid of nnnnn
kill -2 aaaa bbbb cccc dddd -- gently and with compassion kills four processes with pids aaaa, bbbb, cccc, dddd
kill -9 xxxx yyyy -- like Jason-the-13th it just takes these suckers out (xxxx yyyy)
which groups does user X belong to
groups -- will list a number of groups the user of that session belongs to. Example:
[TEST]beeblequix@somedomain:/home/beeblequix> groups
db2iadm1 uucp dialout audio video
This is helpful to know that user beeblequix can play audio files with XMMS because he belongs to the audio group.
what are the contents of a file, shell script, etc.
vi filename.txt -- lets you use the archaic-looking but easy-to-use-once-you-know-it vi editor.
----- g = goto beginning of document
----- G = goto end of document
----- u = undo changes (good to know)
----- i = insert mode
----- dd = delete a line
----- : = command line that you can___
________ write the changes to file with 'w'
________ quit with 'q' or
________ quit-right-now-without-saving with 'q!'
less filename.txt -- uses less cpu & memory than vi; if you want to read a file but don't want to F something up use 'less'
file beeblequix.log -- describes the type of file, in this case ASCII text.
-- (VERY handy if you are not sure whether a file is a proper executable or not, particularly if you are dealing with win32 executables, or in my case with three different architectures -- thx Wells)
From this forum --
--
http://www.linuxquestions.org/questi...ght=cheatsheet
-- see this d00d's 'one page linux manual' (a .pdf). good stuff.
http://homepage.powerup.com.au/~squadron/
how to make my ATI card support 3d in debian
*added 10/21/2005* I actually DID make my Radeon work under Debian...here's the thread:
http://www.linuxquestions.org/questi...hreadid=375259
I'm going to digest this link and post again with specifics to debian.
http://www.alexandern.com/3D_ATI_RADEON_on_Linux.html