Tagged Questions

A file system structure in which to store computer files.

learn more… | top users | synonyms

-2
votes
2answers
66 views

Getting a propmt when deleteing a non-directory

I want to get a prompt when attempting to delete a non-empty directory with rmdir. Is this possible?
0
votes
2answers
55 views

Copy directory not just the contents

I want to copy a directory into another directory. For example, cp -r dir1 dir2 copies the contents of dir1 into dir2. I want to copy dir1 itself into dir2 so that if I ls dir2 it will output dir1 ...
6
votes
2answers
114 views

Folder with ONLY write permission is useless… right?

Having worked with Linux for years, and finding myself with some free time, I decided to revisit some basics. So I re-read the stuff about permissions (without checking source code), and its special ...
2
votes
1answer
73 views

Why does `cp -a . /dir` copy contents instead of directory?

I wanted to copy a directory that I was presently in. I tried cp -a . ~/xyz It copied the contents of the directory, yet this worked: cp -a "$(pwd)" ~/xyz [As desired, this copied the directory ...
0
votes
4answers
48 views

Find a directory created today

How can I find a directory whose name starts with cy and that was created today?
0
votes
1answer
89 views

Delete ghost files with special characters

I have read several ways to delete files with special characters, but none of them works for me in one special folder in my cache system. I have no idea how the files got there, and why they turned ...
3
votes
1answer
58 views

Fine-tune LS_COLORS for directory suffixes?

I’m fine customizing most settings in LS_COLORS. I don’t need help customizing the colors for different file suffixes. What I would like to do is configure special colors for certain directories, ...
4
votes
3answers
82 views

How to securely delete a directory without leaving a trace?

I already know that using shred will overwrite my files in such a way that leaves them unrecoverable. However shred can't be used to hide directories. Error Message: failed to open for writing: ...
9
votes
3answers
681 views

Why are some files and folders hidden?

I can understand the rationale of hiding files and folders in the /home/user directory to prevent users from messing around with things. However, I do not see how the same rationale can be applied to ...
6
votes
1answer
357 views

Expand ~, . and `..`

Since ~, . and .. are special directories, why are they handled differently in the following example? $ echo ~ /home/tim $ echo .. .. $ echo . . ~ is expanded into the dir, but the other two are ...
0
votes
3answers
69 views

How do pwd and . determine the current path differently?

Is it mainly because pwd is not a builtin, while . is builtin to the bash shell? For example, they differ in the following example: /tmp/ttt$ mv ../ttt ../tttt /tmp/ttt$ pwd /tmp/ttt /tmp/ttt$ cd . ...
3
votes
5answers
80 views

How to find and empty some directories

I'd like to find and delete the contents while leaving the directories themselves intact. The following find /data1 -name MyTargetDir -type d -exec rm -rv {} \; and find /data1 -name ...
29
votes
8answers
3k views

How to delete this undeletable directory?

I untarred a corrupt tar file, and managed to end up with some directory that I can not delete, If I try to delete it, it seems like it can not be found, but ls shows it's present, both with bash and ...
3
votes
2answers
80 views

Move every file that is not a directory

I have a directory that I am trying to clean out that contains both files and subdirectories. What I am trying to do is simple: move all the files into another directory, but leave all the ...
4
votes
2answers
54 views

Create new temporary directory

What's an effective way of creating a new /tmp directory, that behaves just like /tmp (purged on reboot, etc.), but in a different location? In my case, I want to create a ~/dev/tmp directory where I ...
2
votes
4answers
139 views

Change to the last modified subdirectory of the current directory

I have an application which generates a couple of files in different directories at a regular interval and I need to check the latest files generated, i.e. the file which is generated in the most ...
0
votes
0answers
15 views

What are differences between directory order and alphebetic order with `ls`? [duplicate]

What are differences between directory order (-U) and alphabetic order (by default) with ls? They return the same order of a dir's contents to me.
0
votes
1answer
40 views

“Links” to dirs that have features of both hard and soft links?

It is not allowed to create a hard link for a dir. But the soft like will not work, if I later change the name of the dir. How would you solve the dilemma? Are there applications which can ...
5
votes
4answers
263 views

Ways to organize and access frequently visited directories and files?

In my Ubuntu, I have added some frequented directories to the bookmarks of Nautilus, for visiting them quicker. Nautilus can consume a lot of memory, when it has been kept open for long and there ...
2
votes
3answers
67 views

copying parallel directories Why does cp -r work this way?

The following works correctly (ie does what I want) cd /var/www/release/ mkdir wiki cp -rp ../html/wiki ./ However if I do (what seems more intuitive) cp -r ../html/wiki ./wiki it will ...
3
votes
2answers
164 views

Valgrind /usr/lib files are not regular Linux files

The problem that I encountered today (on an embedded device with Linux) is that some files (specifically, the Valgrind /usr/lib files) are behaving very strange and they are not copy-able with scp ...
0
votes
0answers
25 views

In Ubuntu, what is the folder in which MySQL's UDF should be installed?

I am using Ubuntu 14.04. I wonder where should I install binary UDF for MySQL. Is there any way to discover the path of the UDF directory? Is there a standard for this in Ubuntu?
4
votes
5answers
434 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 ...
0
votes
3answers
53 views

cd to the most recently created directory [duplicate]

I have a directory in which a number of directories are created daily. I want to enter into the directory which is created recently whose name starts with cy. How can I find this directory? Could ...
1
vote
3answers
173 views

Removing a directory that has no files in it

I recently created a username and a group called gamesForAdmin. Since then I deleted it and the folder I made for it is still there: drwxr-xr-x 5 root root 4096 Jul 4 11:28 . drwxr-xr-x ...
0
votes
1answer
92 views

remove special character from files in directory

I need to remove special characters from all .htm files in a directory. Ideally I need to keep the file name but if I have to I can copy each file to 1 or something like that. Here is the command I ...
2
votes
1answer
126 views

Create directory using filenames and move the files to its repective folder

I have a folder with around 150 text files. I would like to create folders in the name of the 150 files. After that I would like the text file to be moved to its respective folder. Example names of ...
1
vote
2answers
79 views

Do Links to /tmp files get deleted?

I have a script that creates a temp directory using mktemp -d. A folder generated in the temp directory is the output of the script that will be copied to another part of the machine. I was ...
9
votes
4answers
804 views

Recursively iterate through files in a directory

Recursively iterating through files in a directory can easily be done by: find . -type f -exec bar {} \; However, the above does not work for more complex things, where a lot of conditional ...
1
vote
1answer
363 views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
3
votes
2answers
134 views

Find files in directory with paired names

I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list. All files are in subdirectories of ...
3
votes
1answer
157 views

Write-only permission for a directory doesn't allow to rename (move) files inside?

In fact, I would like to ask more general question -- "what does write permission for a directory allow you to do exactly?" -- but let's approach it with a concrete example. It is a long question, if ...
1
vote
2answers
264 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 ...
0
votes
1answer
31 views

Moved folder into other has now disappeared

Two folders in same directory and I wanted to move one into other with command mv foo /foo2 but now foo has vanished.
9
votes
3answers
360 views

How to spoof/mock a directory used by a binary application as another directory?

Suppose there's a binary application that always writes its data to /tmp. How could I spoof/mock /tmp for the sake of this binary as some other directory (e.g. home/tmp)? Let's assume I have no ...
3
votes
3answers
201 views

Return to directory location prior to cd-ing to home directory

As is well known, cd without an argument changes one's current directory to their home directory. I am wondering if there is any way, after using the cd command like this, to return to the directory ...
2
votes
2answers
233 views

inotifywait different action on file or dir

I'm trying to make a inotifywait script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In ...
4
votes
4answers
1k views

Can the /home folder in Linux contain anything else but user folders?

Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? ...
2
votes
3answers
311 views

What is the difference between path and directory?

I don't understand the difference between path and directory. Could someone explain to me with examples?
2
votes
0answers
63 views

One way diff between 2 directories

I am looking to perform a diff between 2 directories, both of which contain may files and subdirectories. I am hoping to perform a one-way diff between a source and target directory that will return ...
1
vote
1answer
75 views

lost directory cannot find it with testdisk

I was moving a directory on my parents computer using a teamviewer session. The session responds slow and somehow, when I was moving the directory (location: /sdb/synchronisatie/nel/) something went ...
2
votes
2answers
102 views

setting default permissions with setfacl

I am trying to set default permissions on my directory structure using acl. I would like to have following default permissions for directories and for files respectively: drwx--x--- -rw-r----- but ...
1
vote
1answer
367 views

untar specific directory

tar tvf filename.tar gives me: -rwxrwxrwx 0/0 544795 2010-03-15 12:49 35 WOO WORDPRESS THEMES/bloggingstream.zip -rwxrwxrwx 0/0 1659095 2010-03-15 12:51 35 WOO WORDPRESS ...
4
votes
2answers
349 views

Determine what device a directory is located on

If I do # cd / # ln -s /home test # cd test # mount --bind $PWD /mnt the entry in /proc/mounts is /dev/sda2 /mnt ext4 rw,noatime,data=ordered 0 0 which is the device that is mounted to /home and ...
1
vote
1answer
91 views

On why touch, mv, etc., won't create subdirectories “as needed”

There are many Unix commands that will fail unless some subdirectory already exists, even though it would be a trivial matter for such commands to go ahead and create the missing subdirectory before ...
3
votes
2answers
183 views

Command for creating a directory and navigating into it directly? [duplicate]

Quite often I need to perform this two commands: mkdir abc cd abc I am curious whether there is a simple command (or an alias that I can create and use) to do it in one go, like user@GROUP:~$ mdcd ...
1
vote
2answers
48 views

`ls` fails for directory copied from Win and OSX [closed]

I'm not able to ls on a folder that I have just transferred from win7 to OSX via a FAT32 drive. I don't know how to search for an answer for this issue. I've attempted the following: sudo chmod ...
8
votes
5answers
3k views

Merging folders with mv?

If I move a folder with mv called "folder" to a directory that already contains "folder" will they merge or will it be replaced?
2
votes
1answer
2k views

Delete files/ folders with .nfs files

A lot of time when I delete a folder, it says cannot be deleted because of .nfs files Error - Device or resource busy How can I delete a folder ignoring these errors ( is there any flag in rm ...
0
votes
1answer
103 views

Dropbox on both Windows and Ubuntu 12.04.3 LTS

I have Dropbox installed on both Windows 7 and Ubuntu 12.04.3 LTS and there are two separate folders that are being synchronized so there is some waste of disk space. I would like to have only one ...