Hot answers tagged

36

The POSIX standard says A pathname consisting of a single / shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. It makes a distinction between filenames and pathnames. / is a pathname for the path of the root directory. The name of the directory is "the root directory", but in the filesystem it is ...


24

slash is a separator; directory names do not include separators, but full pathnames include the separators. So the "root-level" "/" has no name. On most Unix-like systems, this is treated as a special case like "." and ".." (though of course there is no difference between the two at the root level). Nomenclature can differ. POSIX, for example lists some ...


13

In Unix, files (and directories are just files) don't have "names". Links have names, links are entries in a directory that map names to files. You might say, that links give names to files, but note: this implies that a file can have more than one name, since it can have more than one link. Since the root directory is, well, the root directory, there is ...


4

The use of the word "name" is a little bit flexible; it can refer to a "fully qualified path name"; it could refer to the "directory entry"; it could refer to the "file name" passed to various functions or routines. So, for example, /etc/foo and /var/tmp/../../etc/foo and /tmp/../../../../../../foo are all ways of referring to the same file; they're all ...


4

On a linux system, you can hide process information by mounting /proc with the appropriate hidepid setting, e.g. mount -o remount /proc -o hidepid=2. However, this will not hide process information from anyone with root access. The better solution is to not include sensitive data on the command line.


4

As you mentioned, BTRFS can do this. This is how I regularly backup my laptop (which has an uptime of 9 weeks, 5 days as I type this). Within my BTRFS filesystem, I have subvolumes. The way that you split your data into subvolumes and how you nest them is unimportant here, so long as you aren't using the root of the filesystem to store data that you want ...


3

Better would be to rewrite myapplication so it gets the password via some other mean like stdin. The environ is another option, but that is still visible to processes with the same euid (or euid 0) via /proc/<pid>/environ. If not, on Linux with versions prior to 4.2, you can limit the exposure by making sure the password is not in the first 4096 bytes ...


3

Memory management To display swap usage summary by your device: $ swapon -s To displays the amount of your free and used physical and swap memory: $ free -h To preallocate space to /swapfile, you can use the line below: $ fallocate -l 20G /swapfile % OR $ dd if=/dev/zero of=/swapfile bs=20480 count=1M Change permission and create/activate swap $ ...


3

You just want to increase the swap size on your system using the space from sda2. Your sda2 /dev/sda2 104G 74G 25G 75% / You can add additional swap space to your system by using swap file created on / that will utilize your sda2. Just do: dd if=/dev/zero of=/swapfile bs=20480 count=1M and then do: sudo mkswap /swapfile sudo swapon /...


3

You need to specify the directory name for both source files: cp Assign/LinuxHist Assign/Linuxnotes.txt Resources (There are many more ways of writing this, but this is the simplest form of the command to understand). Now your title has "Copy" but the question says "move". The cp command will copy. If, instead you want to move the file then use the mv ...


3

When configuring a system against your own custom kernel, I would suggest adding a name to the current version in your modified kernel sources. For instance, in Armbian they create their own kernel packages, and add a -sunxi to kernel.release. Takin as an example modifying the 4.6.3 kernel version: root@ruir:/usr/src/linux-headers-4.6.3-sunxi# grep -ri 4....


3

Do use a shell function for this rather than an alias: function redis-ip { docker inspect redis | grep IPAddress | awk 'NR == 3 { print $2 }' | sed 's/[^"]*"\([^"]*\)".*/\1/' } If the sed does what you want or not, I don't know as I don't know what the docker command outputs.


3

No particular meaning, they're just treated literally. It just checks whether the last line contains exactly %%EOF. That happens to be the end marker in PostScript or PDF documents (try tail -n 1 somefile.pdf). perl expands scalar ($var) and list (@list) variables inside double quotes but not hashes/associative arrays (%hash). Note that that code is ...


3

You can't modify sys.stdout like that; sys.stdout is just a TextIOWrapper around real standard output, which is actually file descriptor 1. The result is that things like print (or anything that writes to file descriptor 1 directly) will totally ignore what you've done. In order to achieve true redirection, you have to do something like this: # Copy ...


3

Yes, you may nest if-statements to your heart's content. The issue with your code is, as pointed out in comments to the question, the two exit statements. Taking a branch that triggers any of these will terminate the script. As far as I can see, both exit statements are superfluous and may be removed. You should also make a habit of double-quoting any ...


2

You can redirect the output to /dev/null. sudo mount /dev/"$PARTITION" /media/"$USER"/"$LABEL" &> /dev/null


2

The problem is that you have your alias enclosed in double quotes ("). This means that the $2 in your awk script is passed to the shell and not to awk and that the double quotes in your sed command are screwing your alias up. Your alias should work as expected if you do this instead: alias redis-ip="docker inspect redis | grep IPAddress | awk 'NR==3{print \$...


2

A widely used solution to this problem of how to maintain duplicate machines attacks the problem from a slightly different angle - use a provisioning tool such as Ansible ( or puppet / chef) to script the set up of one machine as required, then use the Ansible scripts to clone a second ( or third, or fourth...) machine as needed. Any change required for the ...


2

There seem to be lots of errors in the transcribed parts of the question, and important bits are missing, but I think I can answer any way. The fact that there are only two port numbers, does not mean there can only be two connections. Connections are distinguished by the four values: source address source port destination address destination port So, ...


1

You should build your driver as module, and configuring the kernel so that you can force unloading modules. So when you change the driver, the kernel will recompile only the driver (and you don't need to install the new kernel, just to load the module from kernel sources.


1

To get an idea of why your process dies, make its parent process print the exit status. The exit status indicates whether the program due to a signal and includes an 8-bit exit code from the process. The 8-bit exit code is conventionally 0 for success and 1..125 to indicate an error. In a C/Perl/… program, you can query the whole exit status. Consult the ...


1

With GNU sed and GNU date: sed -En 's#^Password=.*@([0-9]{2})([0-9]){2}$#date -d "\2/\1 +10 days" +%F#ep' We turn the 2507 to 07/25 as GNU date expects dates in the US style. However note that 07/25 is understood as the 25th of July of the current year. What that means is that if you run that command on 2017-01-02 on a Password=x@2712 input, you'll get a ...


1

Change the onboot value to yes, indicating this device should be activated as boot time. onboot=no to onboot=yes This device should be activated at boot-time


1

I recommend you read this article from RedHat. Hardware Clock, is a clock that runs independently of any control program running in the CPU and even when the machine is powered off so it can keep track of the current time. And hwclock is a utility for accessing the Hardware Clock - also referred to as the Real Time Clock (RTC) or CMOS clock. You can ...


1

When you have the machine working as a hotspot and dhcpd working, you just need to make work as a router - my recommandation is to try finding a guide to setup the version of Fedora you use as a router. It basically comes down to: enable ip forwarding set up routing set up masquerading allow the traffic in whatever firewall you use. I've never used ...


1

Hi developed some years ago a very simple kind of init system named texas flood (www.resulinux.tk) Shutdown processes is very simple to understand. It is controlled by init, until the end of the system shutdown. The system have many runlevels, like 0 , 1 , 2 , 3 ,4 ,5 6. When you call reboot, shutdown or halt in a normally running system, is the same ...


1

From man 7 systemd.special, SPECIAL USER UNITS. When systemd runs as a user instance, the following special units are available, which have similar definitions as their system counterparts: default.target, shutdown.target, sockets.target, timers.target, paths.target, bluetooth.target, printer.target, smartcard.target, sound.target. So ...


1

I resolved the issue by removing that partition's entry from /etc/fstab For reference: none of the actions I took were damaging to the empty partition, it was the fact that I deleted a partition which was listed in /etc/fstab I apologize for bad formatting in the question. I typed out the question on my phone's browser.


1

If you are sending very small quantities of data at a time then it could happen: For every transmit you will receive an ack, possibly with zero byte payload. For every receive you will transmit an ack, possibly with zero byte payload. For every new connection you will transmit/receive a syn, a syn/ack, and an ack. (probably all with zero payload) There ...


1

Download the right driver from here : iwlwifi-6000-4.ucode. Copy the firmware to your /lib/firmware: cp iwlwifi-*.ucode /lib/firmware Load the driver: modprobe -r iwlwifi modprobe iwlwifi rfkill unblock all Edit Install build-essential and linux headers sudo apt-get install build-essential linux-headers-$(uname -r) Download iwlwifi-6000-ucode-9....



Only top voted, non community-wiki answers of a minimum length are eligible