Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [directory]

A file system structure in which to store computer files.

-1
votes
0answers
14 views

Directory's Data Usage in Ubuntu

Directory's disk usage list For indicated directory print a list of files and subdirectories in descending order according to their total disk usage. Disk usage of a simple file is equivalent to its ...
0
votes
0answers
18 views

Can tmpfiles.d remove only files but not directories based on time?

I want to empty /scandir/ of all files including files in sub directories but I don't want any directories themselves removed, which is what happening with the following in /etc/tmpfiles.d/test.conf: ...
2
votes
2answers
34 views

authorize wheel group to rm in specific folder

I would like to authorize wheel group to rm in a specific folder (in this case my folder is "CT"). I've tried to add this line in visudo: %wheel All=(ALL) /bin/rm /CT/ I have a test files "test1" ...
2
votes
2answers
22 views

how to cut first 3 folders from this echo “/home/test/var/opt” ? i need the result “/home/test/var”

How to cut first 3 folders from a string? For example: echo "/home/source/Oracle/test" |cut -d'/' -f4 gives only one folder name, but I need up to the 3rd folder, like below: echo "/home/test/...
1
vote
1answer
44 views

Tools to lock/encrypt folder in debian

Is there any tools to encrypt folder except encfs for debian?
0
votes
2answers
48 views

Command for getting path to mount point of current partition/drive?

Is there an alternative command that does the same thing as findmnt -T . -o TARGET |tail -n 1? Example: If my current working directory is /media/username/HDD/subdir1/subdir2, that command would ...
0
votes
1answer
16 views

Explaining xargs output from two find commands

I have a directory structure of folder1 folder2 folder2a folder2b folder3 folder3a folder3b I am confused by the xargs output of the below command: XXXXXX:folder1 user$ find . -type d -...
0
votes
2answers
28 views

Copying diff results files

I have two folders - Folder A and Folder B. I compared the files from both folders using diff command. Now after finding that certain files are only available in Folder A and Certain files in Folder ...
1
vote
2answers
53 views

Why does `find -type d -exec rmdir {} \;` command produce “No such file or directory message”

For testing purposes, I created the following directories. user@linux:~$ mkdir dir0{1..3} user@linux:~$ ls -l total 12K drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir01 drwxr-xr-x 2 user user 4.0K ...
1
vote
1answer
42 views

What does it mean to open a directory in vim?

I did vim myDirectory, and got weird output that I don't know how to interpret.
0
votes
1answer
26 views

Default Directories Not Working In OpenSSL Configuration File

I have set the directory in the /etc/ssl/openssl.cnf file but every time I issue the command openssl req -x509 -newkey rsa:4096 -keyout cakey.pem -out cacert.pem -days 3650 it places the files in ...
0
votes
2answers
44 views

Compare two directories for a certain extension and then move the missing ones to a new directory [closed]

Editing and changing the verbiage to make it more clear - I have .dm4 files in both dirA and dirB. My reference folder is dirA and I want to list all the .dm4 files which are missing in dirA which are ...
3
votes
0answers
35 views

When coding for Unix/Linux is it convention to use a trailing slash on path names, or to omit it?

When programming for Unix/Linux, is it best practice to use a trailing slashbor to omit it? For example: Trailing slash baseDir="/path/to/dir/" #code# outPath=${baseDir}addition/to/path/ No ...
0
votes
1answer
54 views

Restore function in unix

I have a script to recover files back to their original location. I am missing the options for the script to as "Do you want to recover this file?" Yes or No. How will I implement it into this code ...
0
votes
1answer
39 views

How to find duplicate directory paths even if the contents are different?

I've searched high and low but it seems all but one (Find and list duplicate directories) topic I've found actually deals with my situation, and the result isn't quite what I need. Edit: Here's some ...
1
vote
1answer
38 views

Shell script to test ls output for directories

I am trying to make a BASH script to test the files in the working directory and return the files that are directory files. One approach that I can think of is, starting with ls and feeding the ...
0
votes
2answers
56 views

Copy every 10 files from source into a target directory using cp

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
32 views

I have a directory of 110 large files. I want to copy them in the batch of n (e.g., 10) to aws s3 [closed]

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
23 views

Folders and files permissions for SDKMAN tool on Ubuntu

I am Java developer trying to set up my local CI server using Linux Mint. One of the crucial tools I would like to use is SDKMAN - the tool that allowes easy installation and management of different ...
1
vote
1answer
41 views

Makefile - How to install a bash script into user's bin directory?

I need to make a Makefile to install a bash script into a user's bin directory, but I'm not sure what the best way of doing this would be. Should I be using a variable that accepts user input to ...
1
vote
0answers
31 views

How to restrict autocomplete for the files found from PATH?

What I would like to be able to do is to have a list of words that are allowed to be autocompleted when typing the first word in the command line. Say, I have PATH=/dir, and the directory /dir has ...
0
votes
2answers
15 views

.tar archive files EACH to its own directory?

I have an archive that contains files from various directories (created with -T option, so I used file with list of files to archive). Files preserve owners and rights. Content is like: var/lib/...
0
votes
0answers
31 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
0
votes
3answers
33 views

How to list all directory paths including a text?

I need to list all directory paths including a text which is part of thier sub-directories. For example, the text is "tpcc" and I have two paths including tpcc as following: /home/arghy/sampledir1/**...
0
votes
0answers
23 views

A way to see your location history within the command line?

Similar to git's reflog, I'm looking for a way to see the directories I have moved through. I have lost something and I'm not sure exactly what happened, and something like the reflog is exactly what ...
0
votes
2answers
25 views

List lastest modified or newly created files in linux

How to list modified or newly created files or directories in linux. So that I can trigger another command or shell script for another task. for eg. A file a.txt and test.txt are modified and I ...
0
votes
0answers
36 views

How to map / mount a directory to another

I have two directories: /volume1/photos/ /volume1/shared_photos/ In shared_photos I have several sub-directories with pictures. What I want to do now is to "mount" or all the files from ../...
0
votes
0answers
27 views

What's causing folder to change ownership?

I have something funky going on with a few folders I'm hosting on a parallel filesystem. Every so often, the group ownership on the folders will revert to root:root Instead of an appropriate service ...
1
vote
1answer
66 views

Git init in wrong directory? How to recover? (theoretical situation)

This is completely theoretical, but I'm new to Git and Linux so I want to know. If I accidentally manage to do git init inside e.g Desktop or Home directory, how to prevent any possible disaster from ...
2
votes
3answers
168 views

How can I make rm -rf ask for confirmation just once at the directory level?

If I use rm -rfi, this asks me every time each file is deleted. If I have a list of rm -rf commands, how can I make it so that the machine asks me for confirmation just once (when trying to delete the ...
1
vote
1answer
66 views

Creating directory tree based on file name

I have a large number of files with the following structure: [Lion] 2015 Africa Book.pdf [Lion] 2015 Africa Magazine.pdf [Lion] 2016 Africa Book.pdf [Lion] 2016 Africa Magazine.pdf [Lion] 2015 Asia ...
0
votes
2answers
58 views

Is it possible to “add” a second folder to the current folder file contents? symlink?

question: Is it possible to "add" the contents of a 2nd folder to the current folder file contents? (In essence I was asking from a full Unix is perspective but may be nginx would work too as the goal ...
-1
votes
1answer
37 views

file -b command return on sticky bit files

I am trying to understand why the file -b command is returning a certain value(s) when the sticky bit is set. When I run file -b <dir> where dir has its group set to g+wrs, file -b returns ...
1
vote
1answer
38 views

How to reference a child directory, that is part of cwd's path?

Is there a generic way to reference a path that is nested an arbitrary level deep along the cwd? This is almost like a reverse relative path lookup. For example: $ pwd /Users/somebody/foo/bar/baz $...
0
votes
1answer
19 views

How can I predefine a path for a user logged in via SSH?

I'm looking for a way to set something like a default path for a user on my server. So for example I've the user XYZ. When I login now with this user on my server, I want to be directly in a defined ...
2
votes
1answer
230 views

“Cannot create directory … no such file or directory”

When executing the dockerfile, the command RUN cp -rf roundcubemail-1.2.3/. /var/www/html/ is executed and I'm getting the following error: cp: cannot create directory '/var/www/html/': No such file ...
0
votes
0answers
143 views

VSFTPD refuses to list directory when PASV is enabled

I'm configuring VSFTPD on Ubuntu 18.04 and have followed all the guidelines. It's working OK for plain FTP (insecure), however as soon as I enable SSL/TLS and Passive mode, it connects, but I am ...
0
votes
0answers
17 views

Copy specific named directories, where content changed the last 24 hours

I can recursively find and copy all my test-directories (with content) of the current directory: find . -name test ! -path "./my_dest/*" -exec cp -r --parents {} /path/to/my_dest \; But now I want ...
0
votes
1answer
91 views

Nemo file manager is completely ignoring `_` at the beginning of directory name, when sorting

Ex. suppose some directories are named absorbing appreciate arrive connect depend drop few fold littlel popcorn shrill sticky In Windows, if I put _ before the directories, it would be at the top, ...
4
votes
2answers
268 views

Find the age of the oldest file in one line or return zero

I want to find the age of the oldest file in a certain directory or return 0 if there aren't any files in this directory. I also need a one-line command doing it. So far this is my command for finding ...
0
votes
1answer
74 views

mv multiple directories into the same directories

I want to move multiple directories to the directories if the second directory exist. Initial: dmv/toto/toto0 dmv/toto1/toto1 dmv/toto2/toto2 dmv/toto0/toto00 dmv/toto2/toto02 Final: dmv/toto/...
2
votes
3answers
59 views

Determine the number of directories inside a tar file without extracting it

I need to count directories inside an archive file (e.g. tar.bz) without extracting the archive. Note that the archive is too big so that it will be hard to extract then count directories using ls | ...
0
votes
1answer
90 views

Linux directories read/write behaviour?

I need to know how the directories of a Linux system are used, in relation to their approximate read/write behaviour in time. So far I have not been able to find any references. Can anybody provide ...
3
votes
1answer
171 views

Permission denied when cd to symlink'd dir in /tmp that is 700 and owned by regular user

Question: Why am I not able to cd into a symlinked directory with 700 permissions, owned by a regular user, as root, when I am able to change into the directory itself? Example: ttucker@plato:/tmp# ...
3
votes
2answers
43 views

find command outputs files without a directory structure

I want to tar some Python files and send it across a server. I do: find /some/path -iname "*.py" -exec tar czfv python_files.tar {} + Followed by: pv python_files.tar| ssh some_user@some_server '...
0
votes
1answer
113 views

Recursively exclude directory with pattern using tar

I have a directory with various python packages that I'd like to archive using tar. I need to exclude the numerous __pycache__ folders that get left behind by the build/testing process but using --...
2
votes
2answers
51 views

How to masquerade a file path as another in Linux

I want to have the file path /var/test appear as /root for the user test123. I don't want them to actually be in the root directory but I want it to appear as being in /root so that they can't tell ...
0
votes
1answer
46 views

Getting find: bad option -o -name abc -o -name xyz when perform search for *.properties excluding set of directories from search [closed]

#!/usr/bin/ksh # ***************************************************************************************** # copy_properties.sh # This script copies *.properties files from all directory excluding ...
-1
votes
3answers
52 views

Mv several file to directory with same basename

I have several files with different extensions and directories with the same basename, like this example. FileA.txt FileA.html FileA.directory/ FileB.txt FileB.html FileB.directory/ FileC.txt FileC....
0
votes
0answers
44 views

cannot permanently delete Xcode.app in trash, not even if with “sudo rm -rf” because directory is not empty?

I run on osx 10.14, and I was trying to delete and reinstall xcode. I have also tried the following in safe mode but have the exact same problems. I moved xcode.app to trash, right clicked and chose ...