A file system structure in which to store computer files.

learn more… | top users | synonyms

0
votes
0answers
32 views

Script file that lists contents of current folder

I have OS X, but I'm guessing it should be the same as in other Unix OSes. I know the command is: #!/bin/bash ls > contents.txt Then you put it into a file called: script.command then you ...
0
votes
2answers
29 views

Where does the find command look first if there are directories with the same name?

Suppose I have two different directories with the same folder names: /usr/myDir/ and /home/myDir/ If I run a command such as: cd $(find / -type d -name myDir) it navigates to /usr/myDir. Why is ...
11
votes
4answers
269 views

How can I find the first missing directory in a long path?

Imagine I have a path that doesn't exist: $ ls /foo/bar/baz/hello/world ls: cannot access /foo/bar/baz/hello/world: No such file or directory But let's say /foo/bar does exist. Is there a quick way ...
-4
votes
0answers
28 views

Finding Parent of a path in Unix [on hold]

I have a query of: $unix_linux/stack_overflow/20160201 This is a sample file name. Is there a way to find its parent? I tried . find but I want to find this specific folder for this date. Not a list ...
0
votes
1answer
23 views

Using if and find together

I'm trying to write a script that echos "success" if it finds .trc files older than 5 days in a directory. However I'm getting a full_path_trace': No such file or directory error even though my ...
2
votes
2answers
51 views

Difference between /usr/bin and /usr/local/bin [duplicate]

What is the difference between /usr/bin and /usr/local/bin? Why are there both directories and why do some executable programs exist in both directories?
3
votes
2answers
53 views

Getting the full path name of a given directory

Suppose I'm in /path/to/dir. Within this dir is another dir called subdir. Is there a command I can issue which outputs the full path to subdir, no matter how it is identified? For example: $ cmd ...
1
vote
0answers
20 views

Bash tab completion not working within symlinked directory

I'm working with Bash 4.2.46 on RHEL7 with the bash-completion packages installed, but I seem to have found an odd corner case where tab completion doesn't seem to work as expected. I have a set of ...
0
votes
1answer
13 views

bash: /home/hadoopuser/hadoop/sbin: Is a directory

I am in Ubuntu 14.04 LTS. Based on how to set a Hadoop cluster I am executing this: # Add Hadoop bin and sbin directory to PATH export PATH=$PATH:$HADOOP_HOME/bin;$HADOOP_HOME/sbin where I know ...
2
votes
4answers
49 views

cd into last alphanumeric directory

I have this directory contents: As you can see, the directory names are just timestamps - in general when I am the top level directory I usually want to open the most recent directory which is the ...
2
votes
2answers
66 views

difference between /dir and /dir/ [duplicate]

Consider a symlink I am making to my Music directory named music. ln -s Music music now consider following sequence of commands: edward@ArchLinux:~$ readlink music Music edward@ArchLinux:~$ ...
1
vote
1answer
24 views

Ways to consolidate music folder

Having used iTunes for a long time, my iPod Classic finally started showing signs of dying. I bought a FiiO X5II and put all my music onto it's microSD XC card(s) using rsync to ensure the same folder ...
0
votes
1answer
27 views

How do I remove a . from the start of a Bash string and write the result to a variable? [duplicate]

I am presently writing a shell function and it would help me in writing it to be able to remove a . from the start of a folder name (changing the folder name from that of a hidden folder to that of a ...
3
votes
0answers
47 views

Reason for security software to not scan directories with more than 10,000 resources in them?

We have a security software on Linux which scans for exploits in files that exist in directories on the server (such as if websites had hack scripts uploaded to them). It defaults to a limit of ...
0
votes
1answer
12 views

Manipulate du's output to get a custom printout [duplicate]

I typically run the command below to check size on each directory. du -sBM /* | sort -nr | head -n20 However, specifying a block size of "M" here will give everything a value in "M". The problem ...
4
votes
2answers
345 views

Is there an inode for a directory?

Each file has an inode. Is there an inode for every directory ? If not, how does Linux manage directories.
1
vote
1answer
43 views

udev creates the right rules, but rights disappear as soon as I try to access files via C++

I'm facing a really strange problem using udev. As I already explained here I'm trying to access some folders/files as a no root user Here are my udev rules for the gpio folder: KERNEL=="gpio*", ...
-1
votes
2answers
58 views

Is this good in order to have an empty directory?

I would like to have a directory mydir with empty content, but I don't know in advance if it already exists, or when it does, if it is empty. So my way is mkdir -p mydir ...
0
votes
4answers
78 views

Flattening complex folder structures with duplicate file names

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...
0
votes
0answers
52 views

Flattening folder structure with duplicate file names [closed]

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...
0
votes
5answers
58 views

File permission issues

Is it possible to change the permissions of a particular directory containing some files from 640, with which it gets generated in that folder and change it to 644 once the files are generated for ...
1
vote
1answer
35 views

Is it possible to overwrite a directory with a file in linux

Can someone please help me with a possible case of accidental deletion on a linux box? I ran the following command: cp file1 /newdir1/folder1 What I intended to do was to copy file1 to the ...
2
votes
2answers
41 views

treating web page like directory

I'm a Mac user and I want to cd to a web page and then cp some files onto a local directory. Is there a way to do this? This is the page I'm referring to: ...
2
votes
1answer
29 views

size of directory reported by ls [duplicate]

I understand the size reported by ls corresponds with number of inodes inside the directory, not their actual size. I have noticed peculiar behavior, when displaying directory size with ls. Here is ...
2
votes
2answers
29 views

popd pushd, does dirstack stores the accessed directorys as a textfile-list somewhere?

I would like to use the recently accessed directories list for logging purposes. Does directory stack stores somewhere the list of folders used by popd and pushd as a text file? If yes where?
1
vote
3answers
80 views

How to find empty directories in unix [duplicate]

I want to show all the empty directories under my home directory, using shell script, can you help me find the code? (without using find's -empty)
10
votes
6answers
641 views

File systems vs partitions vs directories

I am new to Linux so pardon me for the possible confusion you may encounter in this question. From what I understand, filesystem specifies how a partition stores/manages file, with standards such as ...
0
votes
1answer
41 views

Opening .txt file when you open directory

Is it possible to automatically open *.txt file as you open certain directory on Ubuntu? We have a school assignment to make a text file to pop up when you open certain directory. For example, when ...
6
votes
3answers
545 views

What means the dots on a path? [duplicate]

How is "/a/./b/../../c/" equal to /c? I saw this as a question on one of the Stack Exchange sites. Apparently .. means to pop the stack(?). Why is this the case?
10
votes
3answers
1k views

Why is it rm -rf and not rmdir -rf

I've always been curious why the command for deleting everything in a directory is rm -rf. Why aren't there flags to do the same thing with rmdir? Wouldn't it be more intuitive to use rmdir for ...
3
votes
1answer
90 views

Finding empty directories recursively

How can I find every empty directory, let's say, on the /home/.../Desktop. Because I am on Solaris, I can't use the find . -empty -type d command. Is there any other way?
1
vote
1answer
37 views

Linux bash script input without using “read” [closed]

I need to create a bash script where a single argument is passed by the user (without using the "read" input option) at the terminal command line that creates a directory with that name, or otherwise ...
1
vote
0answers
17 views

How are the sizes of Linux directories determined? [duplicate]

The results of ls -lh provides, among other things, a listing of subdirectories and their sizes. As the directories' sizes are not determined by the sum of the files within them, how are they ...
1
vote
2answers
70 views

Use “find” from a specific relative directory [closed]

Suppose I'm in the following directory: /A-dir/B-dir/mydir/… some directories …/x-dir I want find to search from mydir, but mydir is not specifically known in advance; it is defined by the current ...
-1
votes
3answers
86 views

cannot move Directory not empty

Edited due to people want to know more then me just wanting to know how to deal with two directories with same names in different places and move one into another when mv will not allow it if files ...
1
vote
3answers
147 views

Opening current directory from a terminal onto a file browser?

My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to ...
1
vote
3answers
90 views

How to check for valid $PATH directories, and output them telling whether each one is valid or not?

Ok so I got this: check="${PATH//:/'\n'}" The above gets me each path in a simplified manner, and formats it nicely into a variable. Now how do I check each line for existence, and state that for ...
1
vote
1answer
74 views

Aircrack-ng: No /pentest/passwords/wordlists/darkc0de directories

this is my fist question on this forum. I'm currently using Linux Mint 17.2 Cinnamon and trying to run Aircrack-ng to show the password of my own Wi-Fi connection, I got the Handshake too. The problem ...
0
votes
3answers
53 views

Apply a command to all subdirectories/files

In a parent directory, I have several sub-directories, each of them contain one or more space-delimited text files. I have the following command that outputs what I want, but only for an individual ...
-1
votes
1answer
36 views

Unix directory for all users permissions

I'm trying to make a directory where all users can write, but no user can delete another users file in that directory.
1
vote
1answer
46 views

Running command on multiple files within multiple directories

I want to run the command python quast.py -o quast contigs.fasta but I want to do this for multiple contigs.fasta files in multiple directories. I'm running OSX.
-1
votes
1answer
53 views

Looping through files in directories, each matching a pattern [closed]

I want to loop over files matching *.pdf, in the directories matching [A-J]*? I don't understand what is unclear about this question that resulted in putting it on hold.
1
vote
1answer
63 views

sshfs: permission denied when trying to access specific folder

I can access to my specific folder like this: ssh -YX xxx@xxxxxx.xxx.xxxx.xx cd ../the/folder/I/want or with an absolute path ssh -YX xxx@xxxxxx.xxx.xxxx.xx cd ...
3
votes
3answers
193 views

How do I write a script to count the total number of files, and directories in my home directory then display it?

Question is in the title been trying to do this. I want to do it with a for loop. This is what I've come up with so far which does not work. for home in /home/ {.,/}*; do echo "$home"; done I would ...
0
votes
0answers
14 views

How to monitor system, Database Query Values, and the Existance of Files?

I was looking through an old system today, and it had this monitoring software that could send out email alerts. It's very old, but it still seems interesting and useful. It allowed for monitoring ...
-1
votes
1answer
74 views

How to take a directory or file backup using command?

I have uploaded my file there will be a daily changes in that file for safer side i want to take backup that directory,when i tried copy that folder to another it is showing whenever i have created ...
0
votes
2answers
31 views

Retain the ../../../ in wget command

../../../ is removed when i use it with the url in wget command. PLease see below: user $ wget http://n0t.meaning.anything:20000/../../../some/folder/file --2015-10-29 16:48:13-- ...
5
votes
2answers
454 views

How do I get the total size of everything in a directory in one line? [duplicate]

I know I can use du -h to output the total size of a directory. But when it contains other subdirectories, the output would be something like: du -h /root/test . . . . 24K /root/test/1 64K ...
0
votes
2answers
35 views

Does soft linking a directory hard link its subfiles?

Suppose I have the following configuration: Folder A file1 file2 I then create a soft link of Folder A as follows: ln -s A B so that we now have: Folder A file1 file2 Folder B ( symlink of ...
0
votes
0answers
72 views

why are directories which are empty not removed after rmdir?

foreach file (`find . | awk -F/ 'NF == 3'`) echo $file set olddir = `echo $file| cut -f 1-3 -d '/'` echo $olddir set newdir = `echo $olddir | cut -c 1-2,5-` echo $newdir mkdir -p $newdir ...