3
votes
1answer
32 views

Mounted volume name in terminal is different from in GUI

The basic problem is that in the GUI shows a directory name with no space but when I cd to it in the terminal, the directory name has a space in it. What would cause the names to be different? The ...
2
votes
1answer
25 views

Regarding identical copies of gedit files

When ever I save a gedit file in a directory, two copies of it get saved with identical content. Ex: If the gedit file is named as file_name and saved in Home directory then when u ls the Home ...
4
votes
5answers
335 views

Bash pattern to match all files but directories

In bash, how do I specify a pattern that matches everything but subdirectories in current directory. Given that the pattern */ matches all the subdirectories, I tried (with extglob turned on): $ echo ...
1
vote
2answers
71 views

tar compression without directory structure

Under my current directory, I have two sub-directories: dir_1/ - file1.png - file2.png ... - fileN.png dir_2/ - fileA.txt - ... - fileZ.txt When I tar compress the two ...
3
votes
2answers
209 views

Path syntax rules

I'm writing a library for manipulation Unix path strings. That being the case, I need to understand a few obscure corners of the syntax that most people wouldn't worry about. For example, as best as ...
1
vote
1answer
131 views

cp /etc/DIR_COLORS ~/.dir_colors not responding

I'm using CentOS 6.5 and Putty. My problem is that directory file names are shown in dark blue color which is hard to read. I google searched and found this link; basically it's copying the DIR_COLORS ...
3
votes
1answer
154 views

How can there be a directory named `~`?

I was trying to test out this buggy/new tool to see how it works, and it prompted me to choose a directory to use for stuff I am doing. From the directory ~/Code/indep, I typed in ...
3
votes
1answer
93 views

Test for link with trailing slash?

I created in /tmp/test/ mkdir somedir ln -s somedir/ somelink I want to loop through only directories: for file in */ ; do if [[ -d "$file" && ! -L "$file" ]]; then echo "$file is a ...
3
votes
2answers
58 views

Is there a way to condense ../.. parts of a path out programatically?

Say for example I have these types of paths to files in a script: /path/to/some/file/../../file1.txt Is there a command I can call such as readlink that will convert this path to its actual ...
4
votes
1answer
100 views

Using '@' for a directory name

Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for ...
2
votes
5answers
226 views

move a directory with a single character (back quote) as its name [duplicate]

How can I move a directory whose name is just a space? ls -lah drwx------ 4 user1 user1 8.0K Mar 13 14:16 . drwxr-xr-x 3 root root 60 Mar 13 13:48 .. drwx------ 18 user1 user1 4.0K Mar 13 11:18 ...
5
votes
3answers
133 views

Filtering redundant paths from a list of paths

I have a list of relative paths such as this: dir1 dir2 dir2/dir3 dir2/file1 dir3/file2 dir3/dir4 dir3/dir4/file3 In the example above, the specifier dir2/file1 (for example) is redundant, because ...
8
votes
3answers
394 views

What are ./ and ../ directories?

Simple question, but I'm not sure where to look and google doesn't respond to periods and slashes. I'm just trying to count the # of files & directories in the current directory (not including ...
7
votes
1answer
348 views

What is the significance of the dot in bash commands and how is it different from an asterisk?

I'm trying to understand the significance of the dot in bash and how it differs from an asterisk. Can someone please elaborate? For example, what's the difference between cp -ar /foo/. /foo2/ and cp ...
4
votes
2answers
349 views

Dots in path name

I am receiving an error from an application I am running. The error looks like this: john@john-replacement:~/Desktop/yarbu-1.4.8/bin$ sudo yarbu-engine --VERBOSE /usr/local/bin/yarbu-engine: line ...
0
votes
1answer
152 views

Create a File with Touch on a specific Directory

I want a create a file with a specific extension(.done). I am using the command touch. Something Like: touch `basename $UNZIPFILE`".done" It's creating the file but in current directory. I want to ...
4
votes
1answer
804 views

Does tar -x Extract to Current Directory or Does it Extract to the Source of the Archive?

Does tar -x by default just extract to the current directory or does it try to reproduce the original directory structure including overwriting the original source? I know I can specify a folder to ...
1
vote
1answer
846 views

Very basic question, ls a different directory and save file

I seriously can't understand where I'm going wrong with his question. The first part is. List all the file and directory names in /etc which have 1 or more numbers in their name. Remember to use ...
16
votes
3answers
4k views

When should I use a trailing slash on a directory? [duplicate]

Possible Duplicate: How linux handles multiple path separators (/home////username///file) Most commands I use in linux behave exactly the same whether I include the trailing slash / ...
2
votes
2answers
207 views

cp file device:directory on Minix

In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line: cp ...
4
votes
3answers
376 views

Need to delete a directory with name '~' created accidentally

I don't remember exactly how this directory got created. It's name is ~, the alternative we all use for home diretory. I also see a sticky bit attached with this directory. How shall I delete it? I ...
4
votes
2answers
1k views

Trailing slashes on symbolic links to directories

I'm trying to emulate the process of path resolution (see man page path_resolution) in unix-like systems. My OS is Linux with GNU coreutils 8.7. In order to clarify the meaning of extra trailing '/' ...
1
vote
4answers
973 views

Strange directory name, shown with a backslash

I have copied and pasted a directory of files into another. The result is now this one development\ / I do not know what that means? Linux does not even recognize it as a directory now. Also the ...
4
votes
1answer
209 views

What's the name of the top-level directory

I am using Ubuntu. I know by using cd ~/ , I can go to home/ directory. But if I want to go to the directory (I do not know the official name of this directory) which contains etc/, var/, opt/, ... ...
14
votes
4answers
10k views

Converting relative path to absolute path

Is there a *nix command to get absolute(and canonicalized) path from relative path(with current path) or symbolic link?
7
votes
1answer
3k views

Why can't I have a folder and a file with the same name?

I've never had this problem before, but for some reason, I can't rename my folder to packages/. This is the structure: root - packages_old/ - packages When I try to rename the folder with ...
3
votes
6answers
1k views

finding the absolute directory

Here is the scenario: foo/ > data/ > stuff/ > scripts/ -> /.../generic/scripts When calling foo/scripts/bar.sh from any location (other folder or inside the folder), I would like to be ...
5
votes
2answers
71 views

Making a duplicate of a path in Unix

My Unix vocabulary is failing me. I have 5 billion images in /foo/live/images. For the purposes of developing a new version of the app I'd like to make /foo/dev/images into a working path without ...
4
votes
3answers
248 views

Open files in emacs by filename instead of complete path

Assume I have a bunch of directories and can guarantee that no two directories have a common filename (i.e. if foo/bar exists, then bar doesn't exist in any of the other directories). How can I setup ...
4
votes
1answer
3k views

Recursively compare directory contents by name, ignoring file extensions

I have a directory containing about 7,000 music files. I used lame to recursively re-encode all files in it to a separate directory, outputting all files with the same relative path and file name. ...
44
votes
6answers
5k views

How linux handles multiple path separators (/home////username///file)

I'm working on a python script that passes file locations to an scp subprocess. That's all fine, but I'm in a situation where I may end up concatenating a path with a filename such that there's a ...
8
votes
2answers
815 views

the slash (/) after a directory name on shell commands

I have a little question here. If I have two files, say filea and fileb, mv filea fileb would delete fileb rename filea to fileb Then if I have two directories, say dira and dirb, mv dira dirb ...