-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc_basic
More file actions
55 lines (44 loc) · 1.71 KB
/
.bashrc_basic
File metadata and controls
55 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# Posted .bashrc for basic bash.
#
# Simplify commands.
# Now you can use cd1 to change to parent folder.
alias ..="cd ../";
alias ...="cd ../../";
alias ....="cd ../../../";
alias .....="cd ../../../../";
alias ......="cd ../../../../../";
alias cd1="cd ..";
alias cd2="cd ../..";
alias cd3="cd ../../..";
alias cd4="cd ../../../..";
alias cd5="cd ../../../../..";
# For frequently used commands.
alias c="clear";
alias r="reset";
alias q="exit";
# Hint for important operations.
# You will got hints for what you have just done:)
alias rm="rm -v";
# -i, --interactive prompt before overwrite (overrides a previous -n option)
alias cp="cp -iv";
alias mv="mv -iv";
alias date-ymd='date +%Y-%m-%d';
alias date-ymd-hms='date +%Y-%m-%dT%H_%M_%S%z';
# Find with a maxdepth option.
alias find-with-maxdepth='find -maxdepth';
# @see https://stackoverflow.com/questions/5566310/how-to-recursively-find-and-list-the-latest-modified-files-in-a-directory-with-s
alias find-recently-modified-files='ls -t $(find . -type f)';
alias find-recently-modified-files-max-20='ls -t $(find . -type f) | head -n 20';
alias netstat-tulpn='netstat -tulpn'
# save the bash history to ${HISTFILE}_whatever.
# @see https://stackoverflow.com/questions/8473121/execute-command-without-keeping-it-in-history
alias save-bash-history-to-whatever='export HISTFILE="${HISTFILE}_whatever"'
# Print every command being executed.
# @see https://stackoverflow.com/questions/2853803/how-to-echo-shell-commands-as-they-are-executed
alias set-on-xtrace='set -o xtrace'
# Stop printing every command being executed.
alias set-off-xtrace='set +o xtrace'
# @see https://www.linuxjournal.com/content/wi-fi-command-line
alias wifi-scan='sudo iwlist wlp3s0 scan';