It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by ">User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a ">Donation to help aid in operating costs.

ok I wasnt really looking for a description of bash commands... more like combinations of them.I think there is already a post here containing basic bash commands.*rm -rf = remove recurisive and force

dmesg | grep [device name]

outputs boot hardware information about a specific device useful for troubleshooting kernel problems. If the device is CD it will spit out info about your CD roms if you use hd as the device it will tell you about your harddrives

i always find myself using "locate [file] | grep [bin|png]" or whatever file i'm looking forusually either when i'm looking for icons to use i'll do like "locate ethereal | grep png" or when trying to find where a program runs from, "locate mysql | grep bin"enormous timesavers just b/c i don't pay as much attention as i should when i install stuff. well, i make sure i install it right, but about 4 hours later i forget where that was, loland of course, ps -aux | grep [program name]speaking of which, i'm trying to find a way to pipe a process id into kill....but i can't figure it out. kill always comes back with an error everytime i try. i figure it'd be a huge timesaver if i can just write up a shell script where i just type in like "slackill [program]" and by going through ps and grep and cut and kill....it'll kill the process for me//

Unbodied unsouled unheard unseenLet the gift be grown in the time to call our ownTruth is natural like a wind that blowsFollow the direction no matter where it goesLet the truth blow like a hurricane through me

just a question on the first one. doing:for i in ls *gzwouldn't that use 'ls' as a value for i.i think the correct way would to leave out the ls and just dofor i in *gzthat should load all files in the current directory for i, as the for command looks for files anyway. thus the ls should not be needed.//

Unbodied unsouled unheard unseenLet the gift be grown in the time to call our ownTruth is natural like a wind that blowsFollow the direction no matter where it goesLet the truth blow like a hurricane through me

used this one when after converting rtf files to html, i had to move and rename them. well i didn't have to rename them, but i did b/c it made me feel better. the filenames were .rtf.html, and i wanted just .htmlmoving multiple files and renaming them:

#!/bin/bashfor x in *.rtf.html #lists all converted html files in current directorydo i=$(ls $x | cut -d. -f 1) #displays the filename up to the first period. #for most files (in my case all of them) this will be the filename minus the extension echo "Moving $i..." mv $i.rtf.html /www/htdocs/$i.html #copy (or move, if you'd like to do that instead) all files to another directory and rename themdone

this second one i used to automatically generate a page of links to the files i just copied:

pretty self explanatory. note that x is the full filename, and i is the filename without the extension.

i was setting up a large text section on my website, and so i used these two scripts in a cron job while having another program converting lots and lots of rtf files to html. it took a fairly long time, and so i set these up, so ppl could read the texts as they were generated and not have to wait for all of them to complete. speaking of which. does anyone know a really good rtf to html converter. i downloaded one that uses php. and yes it works. but it bloats the files big time. some of them end up being like 400-500k when all they need is 100k or so. needless to say very inefficient, especially when hosting from a cable connection. so if anyone has had any good results with certain conversion utilities, feel free to let me know.//

Unbodied unsouled unheard unseenLet the gift be grown in the time to call our ownTruth is natural like a wind that blowsFollow the direction no matter where it goesLet the truth blow like a hurricane through me

Something I find really useful especially logging in remotely is process controll. I might be explaining the ctrl-alt-del of unix here, but it was something I didnt figure out for like a year into my *nix life.

ctrl-c - kills a processctrl-z - stops or pauses a process and puts it in the background& - launches a process into the background when it follows the command. ie: 'tail /var/log/apache/accesslog &' will write out new entries to the log file to your term window while you use it for other thingsfg - places a stopped task into the foregroundbg - places a stopped task into the background

I find this usefull on bitchx or other command line irc clients that i can stop them, work in my shell, then resume chatting on irc. I also find & usefull for compiling programs. Send:./configure && make && make install &into the background as a background process and free up your term while it compiles and installs.