Tag Info

New answers tagged

1

The reason for EPERM (the permission denied error ) is here: drwxr-xr-x 5 www-data www-data 4096 juil. 30 13:47 . The directory where you are trying to create a file (in other words change contents of the directory-file) is writeable only for user www-data, which you are not. Either mark the directory as writeable for the group, change the user to ...


3

Advisory locking is for processes that cooperate "peacefully". The kernel keeps track of the locks but doesn't enforce them - it's up to the applications to obey them. This way the kernel doesn't need to deal with situations like dead-locks. Mandatory locking was introduced in System V Unix, but it turns out that the design was not the brightest thing. ...


3

An easy way is to just create a directory in /tmp and use a symlink: mkdir /tmp/mine ln -s /tmp/mine /home/me/tmp You may want to chmod 700 /tmp/mine to keep it private. If you instead want to mount an actual separate tmpfs directory: mount -t tmpfs -o size=100M tmpfs /home/me/tmp You need root privileges to do this, but normal permissions rules apply ...


1

Using the @reboot cron keyword, this will execute the specified command once after the machine got booted every time. @reboot rm -rf /dev/tmp/*


0

Hardlink creation on directories would be unrevertable. Suppose we have : /dir1 ├──this.txt ├──directory │ └──subfiles └──etc I hardlink it to /dir2. So /dir2 now also contains all these files and directories What if I change my mind? I can't just rmdir /dir2 (because it is non empty) And if I recursively deletes in /dir2... it will be deleted from ...


1

The standard command-line, indexed file search is locate. The index can be updated with updatedb. Most Linux systems have these tools configured by default (where updatedb is set up as a nightly cron job). The index only stores file paths. It doesn't do any advanced indexing like file type, modified date, etc. but for many simple purposes it is ...


1

Are you familiar with Vim? If yes, then have a look at Ranger. It's a very fast text-based file manager, and uses Vim-like shortcuts. Move around with hjkl. To bookmark current directory, press m, then the key to store the bookmark under. To access the bookmark, press ', then the key you bookmarked it under. To create a directory simply type :mkdir ...


6

Command Line Tools I use autojump myself and I also depend on many aliases for navigating at the command line, e.g.: alias b='cd -' alias c='cd ~/Dropbox/95_2014/work/code' alias d='~/Dropbox' alias lnk='cd ~/Dropnot/webs/rails_apps/linker' alias n='cd ~/Dropnot' alias play='cd ~/play/' alias q='cd ~/Dropbox/95_2014/work/code/ruby__rails/ruby/ruby_quiz' ...


3

As for a GUI solution I use and suggest Thunar (it's of course available for other desktops too). It's fast, lightweight and stable, it's memory footprint is almost unnoticeable (~70 MiB on 30+ tabs on two separate windows). Some of its features include: Tab navigation. Drag/drop Bookmarks. Select files by pattern (Ctrl+S). Batch file and directory ...


5

Personally, I have never understood the use of fully-fledged file managers. I deeply prefer to use coreutils for file management. As a result, my solution for this would be to suggest a directory management utility. There are a myriad of these, and I have never personally found a use for them so I can make no personal recommendation. But, below are a few ...


4

async is the opposite of sync, which is rarely used. async is the default, you don't need to specify that explicitely. The option sync means that all changes to the according filesystem are immediately flushed to disk; the respective write operations are being waited for. For mechanical drives that means a huge slow down since the system has to move the ...


0

I found an article suggesting ext4 with following configuration in /etc/fstab: /dev/sda / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1 Here is my source for more information: apcmag.com Good question by the way, I'm planning on installing Linux on a SSD drive too, but didn't think of this before reading your question.


1

From Wikipedia Buffers are also flushed when filesystems are unmounted or remounted read-only, for example prior to system shutdown.


0

Is is as simple as comparing /proc/filesystems with lsmod? No: $ comm -31 <(lsmod | awk 'NR!=1 {print $1}' |sort) \ <(</proc/filesystems awk '{print $NF}' |sort) | fmt anon_inodefs autofs bdev cgroup cpuset debugfs devpts devtmpfs ext2 ext3 fuseblk fusectl hugetlbfs mqueue nfs4 pipefs proc pstore ramfs rootfs rpc_pipefs securityfs ...


1

OP and I worked through this; see comments & chat for details. First, to find the problem process and location, this line in /etc/init/mountall-shell.conf /sbin/sulogin was changed to /usr/bin/ltrace -S -f -o /root/sulogin-ltrace.log /bin/sulogin Excerpt from log: 837 crypt("password", "x") = nil 837 strcmp(nil, "x" <no return ...> 837 --- ...


1

The default behaviour for most Linux file systems is to safeguard your data. When the kernel detects an error in the storage subsystem it will make the filesystem read-only to prevent (further) data corruption. You can tune this somewhat with the mount option errors={continue|remount-ro|panic} which are documented in the system manual (man mount). When ...


1

In addition to the searches recommended by terdon, you could also search by the folder name. So if someone deleted (or moved) the files using a wildcard, you may not find any of your filenames specified in any history file. For example, if someone did: $ cd /home/mydir $ rm * Or $ cd somewhere-else $ mv /home/mydir/* . You wouldn't find any of your ...


2

If it's possible they were moved, try to find them with locate - that would find them if they were moved a while ago, before last run of updatedb (typically daiy): locate --existing --basename 'foo.txt' or using short options: locate -eb 'foo.txt' If that does not find them, you could use the find command. Guess where it could be to choose a ...


5

As a brute force approach, assuming you have access to all user directories and that all users are using bash as their default shell, you could search through their history files: grep 'deletedfilename' /home/*/.bash_history Assuming they were deleted recently enough for the command to still be saved in the user's shell history, that will show you who ...


2

while read -r line; do mkfs.ext4 "$line" done < <(df -k | grep 'media' | cut -d ' ' -f 1) The df command with the grep and cut pipes would give us the list of external hard drive mounts. For instance, the external hard disk will always get mounted automatically to /media in most of the systems. So, I am using df command to check the mounts of the ...


1

Ubuntu is capable of reading and writing files stored on Windows formatted partitions. These partitions are normally formatted with NTFS, but are sometimes formatted with FAT32. You will also see FAT16 on other devices. General Considerations Ubuntu will show files and folders in NTFS/FAT32 filesystems which are hidden in Windows. Consequently, important ...


6

Linux can read (and write) to many filesystems, including ntfs, which is likely how your windows partitions are formatted. Many OS installers (including Ubuntu apparently) will scan your disks for any partitions that Linux knows how to mount, and set those up to be mounted at boot, which is why you can access them.


0

Since the 3.6 kernel ext4 suppports metadata checksumming (you'll also need e2fsprogs 1.43+) but it's not clear just how stable this feature is. Additionally you can mount your ext4 filesystem with the journal_checksum feature but... ...it seems like at some point in the past people wanted to make this a default option but this change didn't happen due to ...


0

I think you are mixing up two completely different and independent concepts. The large_file feature that you can see in the output of dumpe2fs means that this filesystem can hold files larger than 2 GiB, I think it is set automatically by modern kernels. It has nothing to do with the -T option of mke2fs.


0

Most distributions have a command called by blkid. blkid will give you a unique identifier for each drive attached to you linux box. Fstab can uses this identifier, replace the /dev/sdc1 with UUID=XXXXXXXXXXXXX. This means that regardless of the user-space designation (e.g. sdc1 scb2 et cetera) your OS will mount it correctly.


0

The answers to this superuser question should answer your question. A few selected quotes: It will just be mounted, and the files disappear, coming back when the folder is umounted. ... It works like a stack, if you mount something else, it hides the previous content. When you unmount, the previous stuff becomes visible again. ... ...


2

If you're absolutely sure that the end of the last partition fits on the target drive, you can copy the drive wholesale. Don't use dd, which is slower (unless used with additional options, and not always even then) and more error-prone; simply use cat. cat /dev/sdc >/dev/sdz Replace /dev/sdz by the proper path to the drive that you want to overwrite. ...


0

Any easy way to improve fsck times even further? @HaukeLaging is right, things can be sped up by changing the density of inodes on the file system. See newfs -i.


1

Mount them read-only, when possible, and the fsck won't be necessary. But you really need to be more specific (what partitions are you talking about? Were's just guessing without and fstab) and especially understand that things happen like that for a reason. E.g. sshd is on /usr and your user profile is on /home. Assuming these are separate partitions, ...


1

You can use dd to create copies of the partitions and not of all the device. dd if=/dev/sad1 of=/tmp/boot.img dd if=/dev/sad2 of=/tmp/root.img As for Q2b: I did this several times, never had a problem, but still this is not recommended.


0

Sounds like the file still in use (opened by other application) Try these steps Identify PID of the application that is still using the file by lsof <fielname>, let's say 12345 for example Go to /proc/12345/fd directory, hopefully you see a link that links to the file you want Try to copy it to another location


1

Each underlying filesystem is assigned a precedence. If there are duplicate filenames, the one from the higher precedence filesystem is the visible one, the others are hidden. See http://superuser.com/questions/326190/how-does-unionfs-work


3

On the surface, what you've suggested you've tried works for me. Example $ mkdir -p test/src test/firefox $ tree --noreport -fp . `-- [drwxrwxr-x] ./test |-- [drwxrwxr-x] ./test/firefox `-- [drwxrwxr-x] ./test/src Make the symbolic link: $ ln -s test/src test/firefox $ tree --noreport -fp . `-- [drwxrwxr-x] ./test |-- [drwxrwxr-x] ...


0

cp -rfp from_dir to_dir -r - recursive -f - force -p - preserve attributes: mode, ownership, timestamps


3

for f in *.csv; do IFS= read -r line < "$f" && case $line in (*HEADER*) continue; esac printf >&2 'ERROR: Missing HEADER record for "%s"\n' "$f" mv -- "$f" "${f%.*}.head" done


1

Try: for _file in *.csv do if ! grep -q 'HEADER' <(head -n 1 -- "$_file") then echo >&2 "ERROR: Missing HEADER record for $_file" # mv -- "$_file" "${_file%.*}.head" echo "$_file" "${_file%.*}.head" fi done Using echo line to verify if it works right, if everything ok, try mv line.


1

I believe that adding nobootwait to the fstab entries would work, but openbsd may not implement that. mountalll, used with Upstart, does. I think systemd does too.



Top 50 recent answers are included