Linux Terminal Hacks (Ubuntu 9.10, Fedora 12)

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

These common terminal hacks should work in any version of linux, by terminal hacks I mean setting up some quick aliases to commands which you use frequently. For this you need to edit your .bashrc file located in your home folder. Open the file using a text editor of your choice, e.g. gedit:

gedit .bashrc

Add the aliases at the end of the file:

export EDITOR=emacs
(if you want emacs to be your default editor)

alias ll='ls -al' (to list all files with all permission details)

alias dfh='df -h' (to list the disk usage of your mounted partitions)

alias duh='du -h' (to list the size of the present directory )

alias gitstat="git status | sed '/Untracked files/q'"
(to list the status of git repository without listing the untracked files)
procs='ps -A' (to list all the current processes)

source /opt/intel/Compiler/11.1/056/bin/ifortvars.sh ia32
(if you are using fortran 11 compiler and need to load it automatically
everytime you open a terminal)

homepc='ssh -X username domainoripofyourhomepc'
(to ssh your home computer with X forwarding)

Save your .bashrc file and close the terminal and reopen it and all your shortcuts should be active now.

Remember if you want to search for pid (process id) of a running process (you might need it to kill it using kill command), you can use the following command to check the pid of firefox:

ps -A | grep -i firefox

And you can kill a non-responsive process with:

kill pid (this is the number you found using the command above)

For more terminal commands look at the related posts.

You might also like

Make Ubuntu 10.10 Look Like Snow Leopard in One Step! We had tried...
Search or Recall Commands Typed in Linux Terminal Whether you...
Add Launch Terminal Here Context Menu in Nautilus Launch terminal...
View and Delete Recent Terminal Command (s) History in Ubuntu In Ubuntu,...

About the Author

has written 346 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

One Comment on “Linux Terminal Hacks (Ubuntu 9.10, Fedora 12)”

Trackbacks

  1. Linux Terminal Hacks (Ubuntu 9.10, Fedora 12) « Hack Your Life! | Just linux!

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2019 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes