Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
fcd7da3a
Unverified
Commit
fcd7da3a
authored
Dec 29, 2021
by
Majid Hadavand
Committed by
GitHub
Dec 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(common-aliases): add single-column and recursive `ls` aliases (#10096)
parent
8d58994d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
49 deletions
+53
-49
README.md
plugins/common-aliases/README.md
+51
-49
common-aliases.plugin.zsh
plugins/common-aliases/common-aliases.plugin.zsh
+2
-0
No files found.
plugins/common-aliases/README.md
View file @
fcd7da3a
...
@@ -12,51 +12,53 @@ plugins=(... common-aliases)
...
@@ -12,51 +12,53 @@ plugins=(... common-aliases)
### ls command
### ls command
| Alias | Command | Description |
| Alias | Command | Description |
|-------|---------------|--------------------------------------------------------------------------------|
| ----- | ------------ | --------------------------------------------------------------------------- |
| l |
`ls -lFh`
| List files as a long list, show size, type, human-readable |
| l |
`ls -lFh`
| List files as a long list, show size, type, human-readable |
| la |
`ls -lAFh`
| List almost all files as a long list show size, type, human-readable |
| la |
`ls -lAFh`
| List almost all files as a long list show size, type, human-readable |
| lr |
`ls -tRFh`
| List files recursively sorted by date, show type, human-readable |
| lr |
`ls -tRFh`
| List files recursively sorted by date, show type, human-readable |
| lt |
`ls -ltFh`
| List files as a long list sorted by date, show type, human-readable |
| lt |
`ls -ltFh`
| List files as a long list sorted by date, show type, human-readable |
| ll |
`ls -l`
| List files as a long list |
| ll |
`ls -l`
| List files as a long list |
| ldot |
`ls -ld .*`
| List dot files as a long list |
| ldot |
`ls -ld .*`
| List dot files as a long list |
| lS |
`ls -1FSsh`
| List files showing only size and name sorted by size |
| lS |
`ls -1FSsh`
| List files showing only size and name sorted by size |
| lart |
`ls -1Fcart`
| List all files sorted in reverse of create/modification time (oldest first) |
| lart |
`ls -1Fcart`
| List all files sorted in reverse of create/modification time (oldest first) |
| lrt |
`ls -1Fcrt`
| List files sorted in reverse of create/modification time(oldest first) |
| lrt |
`ls -1Fcrt`
| List files sorted in reverse of create/modification time(oldest first) |
| lsr |
`ls -lARFh`
| List all files and directories recursively |
| lsn |
`ls -1`
| List files and directories in a single column |
### File handling
### File handling
| Alias | Command | Description
|
| Alias | Command | Description |
|
-------|-----------------------|------------------------------------------------------------------------------------
|
|
----- | --------------------- | -------------------------------------------------------------------------------
|
| rm |
`rm -i`
| Remove a file
|
| rm |
`rm -i`
| Remove a file |
| cp |
`cp -i`
| Copy a file
|
| cp |
`cp -i`
| Copy a file |
| mv |
`mv -i`
| Move a file
|
| mv |
`mv -i`
| Move a file |
| zshrc |
`${=EDITOR} ~/.zshrc`
| Quickly access the ~/.zshrc file
|
| zshrc |
`${=EDITOR} ~/.zshrc`
| Quickly access the ~/.zshrc file |
| dud |
`du -d 1 -h`
| Display the size of files at depth 1 in current location in human-readable form
|
| dud |
`du -d 1 -h`
| Display the size of files at depth 1 in current location in human-readable form |
| duf |
`du -sh`
| Display the size of files in current location in human-readable form
|
| duf |
`du -sh`
| Display the size of files in current location in human-readable form |
| t |
`tail -f`
| Shorthand for tail which outputs the last part of a file
|
| t |
`tail -f`
| Shorthand for tail which outputs the last part of a file |
### find and grep
### find and grep
| Alias | Command
| Description
|
| Alias | Command
| Description
|
|
-------|-----------------------------------------------------|-----------------------------------------
|
|
----- | -------------------------------------------------- | ------------------------------------
|
| fd
\*
|
`find . -type d -name`
| Find a directory with the given name
|
| fd
\*
|
`find . -type d -name`
| Find a directory with the given name
|
| ff |
`find . -type f -name`
| Find a file with the given name
|
| ff |
`find . -type f -name`
| Find a file with the given name
|
| grep |
`grep --color`
| Searches for a query string
|
| grep |
`grep --color`
| Searches for a query string
|
| sgrep |
`grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}`
| Useful for searching within files
|
| sgrep |
`grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}`
| Useful for searching within files
|
\*
Only if the
[
`fd`
](
https://github.com/sharkdp/fd
)
command isn't installed.
\*
Only if the
[
`fd`
](
https://github.com/sharkdp/fd
)
command isn't installed.
### Other Aliases
### Other Aliases
| Alias
| Command
| Description |
| Alias
| Command
| Description |
|
-----------|---------------------|-------------------------------------------------------------
|
|
-------- | ------------------ | -----------------------------------------------------------
|
| h
|
`history`
| Lists all recently used commands |
| h
|
`history`
| Lists all recently used commands |
| hgrep
|
`fc -El 0 \| grep`
| Searches for a word in the list of previously used commands |
| hgrep
|
`fc -El 0 \| grep`
| Searches for a word in the list of previously used commands |
| help
|
`man`
| Opens up the man page for a command |
| help
|
`man`
| Opens up the man page for a command |
| p
|
`ps -f`
| Displays currently executing processes |
| p
|
`ps -f`
| Displays currently executing processes |
| sortnr
|
`sort -n -r`
| Used to sort the lines of a text file |
| sortnr
|
`sort -n -r`
| Used to sort the lines of a text file |
| unexport
|
`unset`
| Used to unset an environment variable |
| unexport
|
`unset`
| Used to unset an environment variable |
## Global aliases
## Global aliases
...
@@ -77,7 +79,7 @@ $ find . -type f 2>/dev/null
...
@@ -77,7 +79,7 @@ $ find . -type f 2>/dev/null
```
```
| Alias | Command | Description |
| Alias | Command | Description |
|
-------|-----------------------------|-------------------------------------------------------------|
|
----- | --------------------------- | ----------------------------------------------------------- |
| H |
`\| head`
| Pipes output to head which outputs the first part of a file |
| H |
`\| head`
| Pipes output to head which outputs the first part of a file |
| T |
`\| tail`
| Pipes output to tail which outputs the last part of a file |
| T |
`\| tail`
| Pipes output to tail which outputs the last part of a file |
| G |
`\| grep`
| Pipes output to grep to search for some word |
| G |
`\| grep`
| Pipes output to grep to search for some word |
...
@@ -97,23 +99,23 @@ that file will be open with `acroread`.
...
@@ -97,23 +99,23 @@ that file will be open with `acroread`.
### Reading Docs
### Reading Docs
| Alias | Command
| Description
|
| Alias | Command
| Description
|
|
-------|-------------|-------------------------------------
|
|
----- | ---------- | ----------------------------------
|
| pdf |
`acroread`
| Opens up a document using acroread
|
| pdf |
`acroread`
| Opens up a document using acroread
|
| ps |
`gv`
| Opens up a .ps file using gv
|
| ps |
`gv`
| Opens up a .ps file using gv
|
| dvi |
`xdvi`
| Opens up a .dvi file using xdvi |
| dvi |
`xdvi`
| Opens up a .dvi file using xdvi |
| chm |
`xchm`
| Opens up a .chm file using xchm
|
| chm |
`xchm`
| Opens up a .chm file using xchm
|
| djvu |
`djview`
| Opens up a .djvu file using djview
|
| djvu |
`djview`
| Opens up a .djvu file using djview
|
### Listing files inside a packed file
### Listing files inside a packed file
| Alias
| Command | Description
|
| Alias
| Command | Description
|
|
---------|-------------|-------------------------------------
|
|
------ | ---------- | ---------------------------------
|
| zip
|
`unzip -l`
| Lists files inside a .zip file
|
| zip
|
`unzip -l`
| Lists files inside a .zip file
|
| rar
|
`unrar l`
| Lists files inside a .rar file
|
| rar
|
`unrar l`
| Lists files inside a .rar file
|
| tar
|
`tar tf`
| Lists files inside a .tar file
|
| tar
|
`tar tf`
| Lists files inside a .tar file
|
| tar.gz
|
`echo`
| Lists files inside a .tar.gz file
|
| tar.gz
|
`echo`
| Lists files inside a .tar.gz file
|
| ace
|
`unace l`
| Lists files inside a .ace file
|
| ace
|
`unace l`
| Lists files inside a .ace file
|
### Some other features
### Some other features
...
...
plugins/common-aliases/common-aliases.plugin.zsh
View file @
fcd7da3a
...
@@ -12,6 +12,8 @@ alias ldot='ls -ld .*'
...
@@ -12,6 +12,8 @@ alias ldot='ls -ld .*'
alias
lS
=
'ls -1FSsh'
alias
lS
=
'ls -1FSsh'
alias
lart
=
'ls -1Fcart'
alias
lart
=
'ls -1Fcart'
alias
lrt
=
'ls -1Fcrt'
alias
lrt
=
'ls -1Fcrt'
alias
lsr
=
'ls -lARFh'
#Recursive list of files and directories
alias
lsn
=
'ls -1'
#A column contains name of files and directories
alias
zshrc
=
'${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc'
# Quick access to the .zshrc file
alias
zshrc
=
'${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc'
# Quick access to the .zshrc file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment