Useful Linux/UNIX commands.

Using wild-cards to display various files in a folder with ls. I recently needed to check whether certain files were in the /usr/lib folder and I used the ls command to do this. to find all files related to the Perl programming language in the /usr/lib directory. ubuntu ~ $ ls /usr/lib/*perl* /usr/lib/libperl.so.5.18 /usr/lib/libperl.so.5.18.2   … Read more

Very nice Linux commands. These are most useful for a desktop user.

Get a nice urxvt windows with a fixed font and lovely colors. urxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint DarkSlateGrey -fade 50 -fadecolor redurxvt -fn "fixed" +sr +st -fg "#FFFFFF" -bg "#000033" -bd "#302c64" \ -ip +sb -title "*-Home-${HOME}-Shell-${SHELL}-Display-${DISPLAY}*" \ -tint DarkSlateGrey -fade 50 … Read more

How to use the sed command to filter text files in Linux and other useful shell tricks for the Linux command line.

Using sed to filter a text file and change a specific character for another. In this case the ” character becomes the ‘ character using the magic of the sed command. Since I am using a character the shell also uses I have to escape it out so the command will work. This can make … Read more

The proper way to use grep without cat. And some nice tricks.

This is the proper way to use grep. You do not need to use cat at all. This method works well and is one command, not two piping together. jason@jason-desktop:~/Documents$ grep apt-get ../.bash_history sudo apt-get update sudo apt-get install me-tv sudo apt-get update && sudo apt-get install xvst apt-get moo apt-get moojason@jason-desktop:~/Documents$ grep apt-get ../.bash_history … Read more

How to strip all of the text out of a text file and leave only the numbers and formatting. And other sed tricks.

How to strip all numbers out of a text stream This is how to remove all text from the output of a file and only keep the other formatting. homer@deep-thought ~/Desktop/b $ fortune -l | sed s/[a-z]/\ /gi; : 3:15 . . – .   , ! — ’84homer@deep-thought ~/Desktop/b $ fortune -l | sed … Read more

Some very useful Linux tips for the desktop and terminal user.

Very useful Linux tips and tricks for the terminal userVery good find command trickInstall a very nice slim desktop on Linux Mint and UbuntuSet a locale on a Debian systemChange the Plymouth theme on ubuntuList only directories in a directory listing with ls Very useful Linux tips and tricks for the terminal user Very good … Read more

Very useful Linux tips and tricks for the Linux desktop user.

Very useful Linux tips and tricks for the terminal userVery good find command trickInstall a very nice slim desktop on Linux Mint and UbuntuSet a locale on a Debian systemChange the Plymouth theme on ubuntuList only directories in a directory listing with lsHow to make the Xterm font larger.Using the .inputrc file to control keybindings … Read more

How to list the installed files of a certain package and other useful tips.

To list all the files installed by a certain Debian package, use this command. dpkg -L [PACKAGENAME]. For example. ubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj /usr/share/bug/vim/script /usr/share/doc /usr/share/doc/vimubuntu ~ $ dpkg -L vim /. /usr /usr/bin /usr/bin/vim.basic /usr/share /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/vim /usr/share/bug /usr/share/bug/vim /usr/share/bug/vim/presubj … Read more

Awesome Linux tricks and tips.

Some very useful Linux tricks and tips. Convert a Linux text file to DOS format with AWK. ┌──(john㉿DESKTOP-PF01IEE)-[~] └─$ awk ‘{sub(/$/,"\r")};1’ hello.txt > dodo2.txt┌──(john㉿DESKTOP-PF01IEE)-[~] └─$ awk ‘{sub(/$/,"\r")};1’ hello.txt > dodo2.txt Convert a DOS text file to UNIX format. [jason@darknet:~] awk ‘{sub(/\r$/,"")};1’ dodo2.txt > dodo3.txt[jason@darknet:~] awk ‘{sub(/\r$/,"")};1’ dodo2.txt > dodo3.txt Get your Internet-facing IP address from … Read more

Some awesome UNIX tricks. Create a file that is hard to delete.

Very old CRT terminal.

Here is one for any experimenters out there… It is possible to create files which simply cannot be deleted from the standard shell. To do this you will have to physically create the file using a script or a text editor, and you will have to use a sequence of control characters which cannot be … Read more

Cool Linux tricks and hacks for the desktop and server user.

Using the shellshock bash bug on an iMac. iMac04:~ admin$ env VAR1=’me() {echo "hello"}\ ‘ /bin/echo "hello" helloiMac04:~ admin$ env VAR1=’me() {echo "hello"}\ ‘ /bin/echo "hello" hello Getting free hard disk space easily. iMac04:~ admin$ df -Hla Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 89G 64G 25G 73% 15757422 6089307 72% … Read more

Some useful Linux scripts for the desktop Linux user who likes the command line.

There are many useful Linux tips that make the life of a Linux user much easier. One is for the VI or VIM editor. To open a file at a specific line; use this command. homer@deusexmachina ~/Documents/yadex-1.7.901 $ vim src/x11.h +33homer@deusexmachina ~/Documents/yadex-1.7.901 $ vim src/x11.h +33 This will open the file x11.h at line 33. … Read more

Useful Linux networking tricks.

Change the mac address of your network adapter. sudo ifconfig wlan0 down && sudo ifconfig wlan0 hw ether 00:11:22:33:44:55 && sudo ifconfig wlan0 upsudo ifconfig wlan0 down && sudo ifconfig wlan0 hw ether 00:11:22:33:44:55 && sudo ifconfig wlan0 up This will change the mac address of your network interface instantly. Below is an example. homer@deusexmachina … Read more

Some useful Linux commands and tricks for the bash shell user.

The boxes utility for Linux allows you to render an ascii text box around text. Below is an example. homer@homer-eME730 19:14:21 ~ $ echo `echo "This is a sentence printed to the terminal."` | boxes /***********************************************/ /* This is a sentence printed to the terminal. */ /***********************************************/homer@homer-eME730 19:14:21 ~ $ echo `echo "This is a … Read more

More useful shell tricks for bash. These are very useful tricks for any Linux user.

This sed trick will filter out the unwanted characters and leave only the letters ‘A’. homer@deusexmachina ~ $ echo "###AAA" | sed ‘s/###//gi’ AAAhomer@deusexmachina ~ $ echo "###AAA" | sed ‘s/###//gi’ AAA This is how to re-bind the annoying CAPS-Lock key to Esc. This can give that key a new use. xmodmap -e ‘clear Lock’ … Read more