All Questions
5
questions
-1
votes
1
answer
166
views
In Bash, how to test if there is a directory with the given path?
I have the following bash code:
drlist="/backups /Blogs /data /dpkg-repack /Scripts /var/www";
for word in $drlist; do
echo $word;
done
What I need to do is test to see if the $word exists as a ...
0
votes
2
answers
2k
views
Why does `rm -rf`` silently fail?
[EDIT]
Please don't waste your time reading my question below. It turns out my colleague is an idiot.. :)
On my server I'm trying to remove a folder and all its subfolders with the usual rm -rf ...
2
votes
1
answer
113
views
How can I create several folders?
How can I create several subfolders in folder in one command.
For example, I want to create:
/home/user/*create dir1*/*create dir2*/*create dir3*/
Provided, I don't have dir1. And I can't use 3 ...
2
votes
4
answers
422
views
How to cd to a newly created dir?
cd "$(mkdir -v "$(date -R)"|sed s+.`(.*)'.*)"
This is meant to create a dir named $(date -R). I could simply cd $(date -R), but the culprit is the date could change since the previous command was run ...
5
votes
1
answer
2k
views
Changing the order of columns displayed with `ls`
Is it possible to change the order of displayed columns when running ls -l on *nix (or dir on Windows)?
For example, I'd like to see the date modified, then the name, then other fields (or select ...