Difference between revisions of "General Command-line Tips"
(Created page with "= Introduction= Tips for using the command line = GNU Parallel= To check the md5sums of a number of files according to a md5sum, one mat use this: cat <file_with_md5sums>...") |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Tips for using the command line | Tips for using the command line | ||
| + | |||
| + | = .bashrc = | ||
| + | |||
| + | This is a hidden (starts with a dot) file in your home directory which is used for holding various customisations in the shape of aliases and functions that minimise typing and make things faster. | ||
| + | |||
| + | For example, to obtain a long listing of all files in a directory from oldest to newest, the command is | ||
| + | ls -altr | ||
| + | |||
| + | But you can include a line in your '''.bashrc''' like so | ||
| + | |||
| + | alias ltr='ls -altr' | ||
| + | |||
| + | which mean s | ||
| + | |||
| + | If you already have a t is also | ||
| + | |||
| + | if [ -f /etc/bashrc ]; then | ||
| + | . /etc/bashrc | ||
| + | fi | ||
| + | |||
| + | if [ -f /usr/local/Modules/3.2.10/init/.bashrc ]; then | ||
| + | . /usr/local/Modules/3.2.10/init/.bashrc | ||
| + | fi | ||
| + | |||
| + | = Special Characters in Linux = | ||
| + | |||
| + | Let's consider the copyright character. YOu need to hold down Ctrl+ Shift and type UA9. U00A9 will also work, but it's longer of course: ©. | ||
| + | |||
| + | |||
= GNU Parallel= | = GNU Parallel= | ||
| Line 8: | Line 37: | ||
cat <file_with_md5sums> |parallel --pipe -N1 md5sum -c | cat <file_with_md5sums> |parallel --pipe -N1 md5sum -c | ||
| + | |||
| + | (it would be nice to know the number of parallel processes this would generate) | ||
Latest revision as of 15:40, 14 September 2017
Introduction
Tips for using the command line
.bashrc
This is a hidden (starts with a dot) file in your home directory which is used for holding various customisations in the shape of aliases and functions that minimise typing and make things faster.
For example, to obtain a long listing of all files in a directory from oldest to newest, the command is
ls -altr
But you can include a line in your .bashrc like so
alias ltr='ls -altr'
which mean s
If you already have a t is also
if [ -f /etc/bashrc ]; then . /etc/bashrc fi if [ -f /usr/local/Modules/3.2.10/init/.bashrc ]; then . /usr/local/Modules/3.2.10/init/.bashrc fi
Special Characters in Linux
Let's consider the copyright character. YOu need to hold down Ctrl+ Shift and type UA9. U00A9 will also work, but it's longer of course: ©.
GNU Parallel
To check the md5sums of a number of files according to a md5sum, one mat use this:
cat <file_with_md5sums> |parallel --pipe -N1 md5sum -c
(it would be nice to know the number of parallel processes this would generate)