I work in material science so many of my directories are named by chemical element or equation. As such, ls
and ls -v
list my directories out of chemical order. I know I could rename my directories so they start with the atomic number of the element, but I don't want to do that. I was wondering if there was a simple way I could provide customized rules to ls
such that it would list the directories according to the atomic number of the element instead of alphabetic or numeric order. If there was an alternative to ls
that would be acceptable too.
Home
/
user-480768
Erik N's questions
I am working on Windows 10 and am using the Ubuntu subsystem. Often I need to change between Windows directories and Linux ones, so I wanted to write a script that automatically converts a Windows path into a Linux path and then changes directories. I wrote the conversion script just fine, but for some reason I can't pass the path to cd.
Example:
$ mkdir temp\ space
$ temp=$(echo "temp\ space") # simulate script that converts path
$ echo $temp
temp\ space
$ cd $temp
-bash: cd: temp\: No such file or directory
Edit:
In hind sight I realized the this actually wasn't my problem, I must have been tired when I wrote this and introduce this bug into my minimal example. My real problem was that I didn't know how to run a shell script in the current shell instead of a subshell. Thank you everyone for your help!