Skip to content

Edit directories as a text file. Rust reimplementation of vidir

License

Notifications You must be signed in to change notification settings

johanholmerin/rsdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rsdir

Edit directories as a text file. Rust reimplementation of vidir from moreutils, with some features from the fork by trapd00r

Installation

cargo install rsdir

Usage

# Say you have a directory that looks like this
├─ old/
│  ├─ file1
├─ file1
└─ file_2

# Running rsdir will open your editor with the following content
1 ./file1
2 ./file_2
3 ./old/

# The numbers are used to keep track of each file - editing a path will
# rename the file/directory while removing a line will delete it

# We can the remove the _ from the second file to make the naming consistent
# and remove the third line, leaving us with the following
1 ./file1
2 ./file2

# Save the file and exit the editor and rsdir will perform the modifications
├─ file1
└─ file2

# If you ran with the --verbose flag you would get the following log
Moved file "./file_2" to "./file2"
Removed directory "./old"

Examples

# Defaults to currenty directory
rsdir

# Supports multiple directories
rsdir ./foo ../bar

# Verbose mode will log what files are moved/deleted
rsdir --verbose

# Use another editor. Will default to vi if EDITOR isn't set
EDITOR=nano rsdir

About

Edit directories as a text file. Rust reimplementation of vidir

Topics

Resources

License

Stars

Watchers

Forks