-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFile_Management.alias
executable file
·62 lines (57 loc) · 3.7 KB
/
File_Management.alias
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
56
57
58
59
60
61
62
# File Management & Operations
# ----------------------------
### Modern ls replacement with icons
alias ls='exa --icons --group-directories-first'
alias ll='exa -l --icons --group-directories-first' # Long list
alias la='exa -la --icons --group-directories-first' # Show hidden files
alias lt='exa -T --icons --group-directories-first' # Tree view
alias lm='exa -l --sort=modified' # Sort by modification time
alias lz='exa -l --sort=size' # Sort by size
alias lr='exa -R' # Recursive list
alias lx='exa -l --sort=extension' # Sort by extension
alias ld='exa -D' # List directories only
alias lf='exa -f' # List files only
alias l.='exa -d .*' # List hidden files only
### File operations with safety and information
alias rm='rm -iv' # Interactive and verbose removal
alias cp='cp -iv' # Interactive and verbose copy
alias mv='mv -iv' # Interactive and verbose move
alias ln='ln -iv' # Interactive and verbose link
alias mkdir='mkdir -pv' # Make parent dirs, verbose
alias chown='sudo chown --preserve-root' # Prevent root ownership change
alias chmod='sudo chmod --preserve-root' # Prevent root permission change
alias rmdir='rmdir -v' # Verbose directory removal
### Advanced file operations
alias trash='gio trash' # Move to trash instead of delete
alias restore='gio trash --restore' # Restore from trash
alias empty-trash='gio trash --empty' # Empty trash
alias symlink='ln -s' # Create symbolic link
alias hardlink='ln' # Create hard link
alias newest='find . -type f -printf "%T@ %p\n" | sort -n | tail -10 | cut -f2- -d" "' # 10 newest files
alias oldest='find . -type f -printf "%T@ %p\n" | sort -n | head -10 | cut -f2- -d" "' # 10 oldest files
alias dups='find . -type f -exec md5sum {} \; | sort | uniq -d -w32' # Find duplicate files
alias big='find . -type f -size +100M' # Find files over 100MB
alias small='find . -type f -size -100k' # Find files under 100KB
alias empty='find . -type f -empty' # Find empty files
alias dirsize='du -sh * | sort -hr' # Directory sizes, sorted
### Archive handling
alias unrar='unrar e -r' # Extract RAR with recursion
alias untar='tar -zxvf' # Extract TAR
alias untargz='tar -xvzf' # Extract TAR.GZ
alias unzip='unzip -q' # Quiet unzip
alias ungzip='gunzip' # Extract GZIP
alias unbzip2='bunzip2' # Extract BZIP2
alias un7z='7z x' # Extract 7zip
alias maketar='tar -czvf' # Create TAR archive
alias makezip='zip -r' # Create ZIP archive
alias make7z='7z a' # Create 7zip archive
alias makebz2='tar -cjvf' # Create BZIP2 archive
### File permissions and ownership
alias mx='chmod a+x' # Make executable
alias 000='chmod 000' # None
alias 644='chmod 644' # User read/write
alias 666='chmod 666' # All read/write
alias 755='chmod 755' # User all, group/other read/execute
alias 777='chmod 777' # All all
alias www='sudo chown www-data:www-data' # Web server ownership
alias own='sudo chown $USER:$USER' # Take ownership