Feed on
Posts
Comments

Archive for the 'Unix' Category

give rm a new undo!

i can now rm with impunity, thanks to the code snippet i’ve inserted into my ~/.profile: alias rm=’safe_rm.sh’ where ‘safe_rm’ refers to this wonderful piece of code i found on the interwebs some months ago [download safe_rm if too lazy to copy+paste; don't forget to rename safe_rm.sh]: #!/bin/sh for file in $*; do if [ […]

where does apt-get sources live?

where does the list of servers apt-get queries live? here: /etc/apt/sources.list

sure sftp is more secure than ftp, but the default client has got some terrible usability problems. for instance, it always really bugged me that i couldn’t tab-auto-complete in sftp.  it’s crazy!  how else do you enter long filenames?! thankfully, i’ve finally found a command-line sftp client that does handle auto-completion: yafc (yet another ftp […]

how to open zip files in debian/linux

to open a zip file in debian, install “unzip” $ sudo apt-get install unzip you can then call unzip to uncompress your zip file.

how to uncompress a .tar.gz file

to decompress a .tar.gz file, try: $tar -zxvf myfile.tar.gz

to send mail from the command-line, use the mailx utility. this works on both mac os x and linux. it’s also super-convenient for cron jobs where you want to auto-send emails; you can’t stick pine into a script. echo “message body” | mailx -s “subject header” recipient@isp.com nb: your message may bounce back, complaining “sender […]

for a while now, i’ve been looking for a unix command-line tool for viewing a machine’s hardware configuration, kind of like “about this mac” in os x or, well, “hardware configuration” in windows. this program does the job reasonably well: lshw. install via: $ sudo apt-get install lshw

to decompress a .tar.bz2 file, go with: > tar xvjf filename.tar.bz2

i decided a couple of months ago to hookup to my linux box a brother laser printer i picked up on craigslist. the idea would be to make this a network printer, accessible from anywhere on my lan. getting this thing installed (an HL-1240) though, was a nightmare. here’s how i finally got it working: […]

if you’ve got access to a file server, rsync can be a godsend. for instance, i use the following one-liner to synchronize my itunes music folder with my music server: rsync -av –progress –size-only –delete –rsh=/usr/bin/ssh ~/Music/iTunes/iTunes\ Music/ user_name@server_address:~/Music/ this command copies all of the music in my laptop’s itunes directory to the ~/Music directory […]

« Prev - Next »