LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Blogs > Skaperen
User Name
Password

Notices


Rate this Entry

new commands that create needed directories

Posted 03-16-2021 at 12:25 AM by Skaperen

i made 2 new commands (with 2 subcommands each) that i will be alpha testing. the 2 commands are named dst and par. the 2 subcommands on each are the same ... ln and mv. there is a --help option, a --version option and a --verbose option. the --help and --version options cause the command to quit after it outputs its information. the --verbose option causes status information to be output.

dst mv moves a file from one path to another, creating all the needed parent directories for the destination path. dst ln works in a similar way but makes a hardlink, instead.

par works like dst, except that you give the path of the directory to move it into or link it into.

they are both nearly identical. they are implemented in Python3 so they are easily ported to any platform with Python3 and the proper file system basics. they might even work on Microsoft Windows. i will be alpha testing them for a while then eventually beta releasing the source code.
Posted in Uncategorized
Views 265 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    i have decided that these commands are a bad idea. the do work. but minor mistakes in usage can lead to many problems. they can be used in scripts OK, but so can mkdir. the big problem is mistyping the directory name. it will do as you say, not as you want. the mistyped name is likely to not exist. but it will be created, anyway, and your moved object will disappear from you, only to show up when you discover the directory with the funny name.

    it is nice to be able to test if the directory is actually there. but mv can already do that with the -t option in front of the directory name.
    Posted 04-20-2021 at 09:17 PM by Skaperen Skaperen is offline
    Updated 04-20-2021 at 09:19 PM by Skaperen
 

  



All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration