date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,460,253,961,000 |
I have an embedded system based on the Intel-Atom with PCH which we are busy developing. In the embedded environment I have:
A Serial console through the PCH which means this doesn't work with the standard kernel. (as CONFIG_SERIAL_PCH_UART_CONSOLE is required)
The SATA drive is only available in the embedded environ... |
I managed to solve my problem with debootstrap, here is a quick run-down of the process I followed.
unmount usb
Partition the USB (4GB)
Zap out GPT with gdisk, as my board didn't want to boot GPT.
Created just one linux partition, nothing else.
I had lots of problems getting a usb drive bootable on my embedded system... | Installing Debian on Embedded system with serial console or network console (PCH) |
1,460,253,961,000 |
I want to run debootstrap multiple times for the same target.
Often I am in transit with no internet access and would like to run it offline.
How can I run the process one with internet access and then multiple times afterwards without internet access?
I am open to using wrappers/alternatives like multistrap and cache... |
You can use squid-deb-proxy as is to run offline (even the InRelease files) but you need to modify it slightly to run debootstrap offline even when you are online.
You need to modify the squid-deb-proxy.conf file so take a copy and put it in your project.
There are absolute paths in the conf file to /etc and /var so y... | How Can I Run debootstrap Offline? |
1,460,253,961,000 |
I am running Ubuntu 14.04.2, 64 bit host system. Using debootstrap, I installed a minimal Ubuntu 14.04.2, 32 bit system in trusty32 directory. This is what my schroot configuration look like:
[trusty_i386]
description=Ubuntu 14.04 Trusty for i386
directory=/home/dipanjan/trusty32
personality=linux32
root-users=dipanja... |
chroot doesn't change processes' personality by default, so within the chroot you still see the host's (kernel) architecture, x86_64.
On the other hand you've set up your trusty_i386 schroot with a linux32 personality, so schroot runs that when setting the chroot up — and linux32 (which links to setarch) changes the c... | Why does uname -m report differently in chroot and schroot environment? |
1,460,253,961,000 |
In https://wiki.debian.org/Multistrap#Steps_for_Squeeze_and_later, it's required to run the following command in chroot environment:
/var/lib/dpkg/info/dash.preinst install
This command runs in Stretch, however there is no /var/lib/dpkg/info/dash.preinst file found in Buster.
What might be the equivalent command to ... |
dash.preinst was removed a year ago, because it was no longer necessary — its purpose was to ensure that /bin/sh’s ownership could switch between bash and dash, but bash stopped shipping /bin/sh.
The equivalent command is nothing, you don’t need to run the preinst any more.
| No /var/lib/dpkg/info/dash.preinst in Buster |
1,460,253,961,000 |
I am trying to install linux in android by chroot method.
Following tutorials available on internet , I tried debootstrap on kali linux and mint. But everytime it returns no output.
debootstrap --verbose –-arch=arm64 -–foreign jessie ./jessie ftp://ftp.debian.org/debian/
I tried various options but it retuns no outpu... |
You should create a mount point then mount the needed partition to install debian e,g: sdaX
mkdir /mnt/debinst
mount /dev/sdaX /mnt/debinst
According to man debootstarp the format is:
debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]]
in your case should be:
debootstrap --verbose –-arch=arm64 -–foreign jessie... | debootstrap not working in kali and mint |
1,460,253,961,000 |
I've set up full working debootstrap-ed arm chroot environment. I can chroot in it, run commands, etc.
I am making a script that will customize chroot env, but I struggle with this.
For example:
chroot $target_dir echo this is a test > /tmp/test
Can anyone explain to me, why within this example I get output written o... |
When you run:
chroot $target_dir echo this is a test > /tmp/test
The > /tmp/test happens "for" the chroot command, much as if you had written:
> /tmp/test chroot $target_dir echo this is a test
If you want the redirection to happen inside of the chroot command, one way would be:
chroot $target_dir sh -c 'echo this i... | Unable to execute redirection in chroot environment |
1,460,253,961,000 |
I am interested to generate a Debian rootfs for aarch64 machine from an x86_64 workstation.
What are the required steps to achieve this ?
As far as I know the proper way is to use debootstrap:
https://wiki.debian.org/es/debootstrap
Is it correct, or there is any other recommended way ?
EDIT: my goal is to build a root... |
When building your own arm64 Debian port, debootstrap will be the best option. There may already exist a working Debian image/tarball/installer for your arm64 board but if you require more granular control over your system, building it yourself will be best.
I am including a link to the Debian Wiki on debootstrap as w... | Building arm / aarch64 rootfs |
1,460,253,961,000 |
I want to create my own Debian Live boot stick from a chroot (debootstrap) environment.
The root filesystem should be mounted as squashfs and grub should be able to boot the system from a single EFI partition.
So far, I have a squashfs image of the chroot environment, vmlinuz and initrd.img on the stick.
However, I do... |
I solved the problem!
First, the chroot environment must have the necessary initframes to load a shquashfs image. For this, I simply installed the live boot packet in the chroot and then updated the initframes. /proc, /dev/pts, /dev, /sys should be available in the chroot for this to work.
# @ root on localhost
mount ... | Live debian USB stick with debootstrap, squashfs and grub |
1,460,253,961,000 |
My goal is to standup a chroot with the basic Unix tool-set (bash, cp, touch, cat, etc) and any necessary dependencies need to run apt get inside a codespace. Using debootstrap gets me close. The basic tools are installed and I can run apt get. The problem is subprocess do not work. I expect the last line to print "te... |
Found the answer here. Turns out /proc was not mounted. To mount proc I ran
$ cd "${CHROOT}"
$ sudo mount --types proc /proc proc/
Now things work!
$ cat < <(echo test)
test
| Subprocess launched inside a chroot created on a codespace with debootstrap fail with /dev/fd/62: No such file or directory |
1,390,493,252,000 |
I am running Linux Mint Debian edition (essentially Debian testing) and the Cinnamon desktop environment. Every time I launch google-chrome it asks to become the default browser. I have told it to do so in all ways I can think of but I still get this pop-up:
What I have tried:
Clicking on "Set as default" in the pop... |
For Chromium, when I choose "Don't ask again", Chromium stores the following setting in my ~/.config/chromium/Profile 1/Preferences file:
{
"alternate_error_pages": {
"enabled": false
},
"apps": {
"shortcuts_have_been_created": true
},
"autofill": {
"negative_upload_rate": 1.0,
"... | How can I make chrome (stop asking to be) the default browser? |
1,390,493,252,000 |
If I launch xterm with its default bitmap fonts and then select the 'Large' font from the 'VT Fonts' menu (via ctrl+right mouse), I get a very usable bitmap font with apparently good Japanese character support.
I'd like to know what this font is so that I can use it elsewhere. Unfortunately, I've found no information... |
The appres utility lists the resources used by an application, both user and default.
appres XTerm xterm
The first argument is the class name (xterm -class Xxx). The second argument, which is optional, is the instance name (xterm -name xxx).
The “Large” font is .VT100.font5 or .VT100.utf8Fonts.font5. See the manual f... | How can I find the default (font) resource XTerm is using? |
1,390,493,252,000 |
In my case, it seems as if LD_LIBRARY_PATH is set to the empty string. But all standard system tools still work fine, so I guess the dynamic linker checks for that case and uses some default for LD_LIBRARY_PATH in that case.
What is that default value? I guess it at least includes /usr/lib but what else? Is there any... |
The usual dynamic linker on Linux uses a cache to find its libraries. The cache is stored in /etc/ld.so.cache, and is updated by ldconfig which looks on the paths it’s given in /etc/ld.so.conf (and nowadays typically files in /etc/ld.so.conf.d). Its contents can be listed by running ldconfig -p.
So there is no default... | What is the default value of LD_LIBRARY_PATH? [duplicate] |
1,390,493,252,000 |
The TCP KeepAlive (socket option SO_KEEPALIVE) is governed by three options—time after which the mechanism triggers, probing interval, and number of failed probes after which the connecting is declared broken.
Their defaults are:
tcp_keepalive_time = 7200
tcp_keepalive_intvl = 75
tcp_keepalive_probes = 9
Sending pro... |
TCP Keep-alive was defined at a time when even the concept of firewall, let alone stateful firewall or NAT, was probably not widespread. From RFC 1122 (October 1989):
4.2.3.6 TCP Keep-Alives
Implementors MAY include "keep-alives" in their TCP
implementations, although this practice is not universally
accepted. If k... | Default TCP KeepAlive settings |
1,390,493,252,000 |
When I open a file into ranger with a GUI application not listed in the rifle.conf file (i.e. using the open_with command), the ranger terminal window gets "suspended" until I close the GUI app.
For this reason, I'd like to have a way to open files with a specific application, but still get the ability to navigate th... |
Try open_with with the f or t flag:
open_with [application] [flags] [mode]
Open the selected files with the given application, unless it is omitted, in which case the default application is used. flags
change the way the application is executed and are described in their
own section in this man page. The mode is... | Ranger - open_with without suspending |
1,390,493,252,000 |
I have 150 Debian Jessie machines that open ODS files in Gnumeric when double-clicked despite LibreOffice Calc being installed. I know it is possible to change this by right-clicking the ODS file and changing its default program from the Properties window, but getting 150 users to do this is not an option. They all us... |
You can use mimeopen with -d option:
man mimeopen :
DESCRIPTION
This script tries to determine the mimetype of a file and open it with
the default desktop application. If no default application is
configured the user is prompted with an "open with" menu in the
terminal.
-d, --ask-default
Let the u... | Setting default application for filetypes via CLI? |
1,390,493,252,000 |
Where is the environment variable $SHELL first set on a UNIX system?
How can I find and print all of this type of default settings of my terminal?
|
Traditionally, by login(1):
ENVIRONMENT
login sets the following environment variables:
HOME The user's home directory, as specified by the password
database.
SHELL The user's shell, as specified by the password database.
Though these days it might be a window manager or... | What sets the $SHELL environment variable? |
1,390,493,252,000 |
How do I set a manually downloaded Firefox as my default web browser so that clicking a link in another application will open the link in this Firefox?
I tried these commands, but they didn't seem to work:
update-alternatives --install /usr/bin/x-www-browser x-www-browser /home/user/firefox/firefox 100
update-alternat... |
update-alternatives changes the application to use to open a web browser, not the application to use to open a web page. The two are not directly related: “I want to browse the web” is different from “I want to browse this web page”, and there are different kinds of content that happen to all open in a web browser.
Wh... | How to set downloaded Firefox to default web browser in Debian? |
1,390,493,252,000 |
I use nautilus as file manager and would like to use Vim instead of Gedit to edit my text files. Many files (log files, empty files, …) are already opened with Vim, however not all of them, e.g. tex files and XML files are still opened with Gedit.
update-alternatives --get-selections | grep edit yields
editor ... |
You should take a look in ~/.local/share/applications/defaults.list under [Default Applications]. There you should set the text/plain to point to the .desktop entry for vim, which is usually located in /usr/share/applications/. E.g:
text/plain=gvim.desktop
| Set default application for particular file types in nautilus |
1,390,493,252,000 |
ARM machines often have a default password. On Arch Linux, this is:
User: alarm
Password: alarm
I am assuming that the "arm" part of "alarm" refers the architecture, but what does the "al" stand for?
Perhaps I am completely off on my assumption.
|
The al part stands for Arch Linux, the arm part for ARM as you surmised.
| What does the "al" in "alarm", the default Arch Linux ARM processor username+password stand for? |
1,390,493,252,000 |
The find command allows you to search by size, which you can specify using units spelled out in the man page:
File uses n units of space. The following suffixes can be used:
`b' for 512-byte blocks (this is the default if no suffix is used)
`c' for bytes
`w' for two-byte words
`k' for Kilobytes (u... |
The first versions of Unix happened to use 512-byte blocks in their filesystem and disk drivers. Unix started out as a pretty minimalist and low-level system, with an interface that closely followed the implementation, and leaked details that should have remained abstracted away such as the block size. This is why tod... | Purpose of find command's default size unit 512 bytes |
1,390,493,252,000 |
I'm using Linux Mint Debian edition and I have set Firefox as my default browser in my settings.
But HTTP links in other apps like hotot and pidgin open with Chromium!
Why is this happening is there any way to track the problem?
|
I'm going to guess the following
all of those tools use XdgUtils
if you type xdg-open http://google.com it'll open with Chromium
and that you have the problem described in this Ubuntu forumspost
So my suggested answer is:
$ xdg-mime default firefox.desktop x-scheme-handler/http
(and ditto for https)
| My default browser is set to Firefox but links open with Chromium |
1,390,493,252,000 |
I often see instructions that include vim or nano, meaning to open the file in that step in your text editor of choice. Is there an agnostic command I can use in place of the specific program that would open the input in the user's default in-terminal text editor, whether it's vim, nano, or something else?
I see edito... |
You can use $EDITOR, provided that it's been defined:
$EDITOR filename.txt
But I think most docs use nano because if someone's blindly following along, it's a safe bet to use. If the user has decided they actually prefer one editor over another, they'll know enough to replace it with vim, emacs, etc themselves.
edit... | Command for the default in-terminal text editor |
1,390,493,252,000 |
Whenever I open an image in feh, the background is set to the standard, dark gray and gray checkboard pattern like this:
As you can see, it's the checkboard background. How do I permanently change this to black?
I've search Google and other places, but I can't seem to find a straight answer. I'm guessing feh's config... |
It seems that you cannot put your desired default options in a config file.
If you know about $PATH you can resort to a hack.
Create this script:
#!/bin/sh
feh --bg-color black "$@"
Call it feh and place it in your $PATH before /usr/bin/ (assuming that feh itself is in /usr/bin/).
Some distros have ~/bin/ in $PATH by... | How to permanently set default color of feh's background to black? |
1,390,493,252,000 |
By default when you start i3wm all work spaces start as vertical/horizontal split splith/splitv layout.
Is there a way to set the a different default like stacking or tabbed as the default for all containers on all work spaces. Some thing I can added to my ~/.i3/config
In stead of manually specifying each work space t... |
If you want to change the behaviour of all new workspaces, just add
workspace_layout stacking
(or tabbed or default) to your .i3/config file, see section 4.8 of the documentation. The default is either horizontal, vertical or automatic, and governed by the default_orientation option, see section 4.7.
You can have fi... | in i3wm how can I set the default layout for all works spaces |
1,390,493,252,000 |
I am on a debian 9 system with unknown desktop environment (ssh access). How can I find out which program is used by default to view a file with a given extension (e.g. pdf)?
Edit: Since extension is not important to the decision, the mime type of the given file can be found by using file
file -i file.ext
|
Ask xdg-mime.
$ xdg-mime query default application/pdf
atril.desktop
| How can I check which application opens a file by extension? [duplicate] |
1,390,493,252,000 |
I have a crontab which launches tmux-launching-script as follows :
-sh-3.00# crontab -l
@reboot /root/scripts/tmux_autostart.sh
where
#!/bin/bash
# setup tmux session
tmux new -d -s my_session
but when the system boots I don't have my regular prompt but shell prompt :
-sh-3.00#
how to change it to bash if I alr... |
Your @reboot job is in root's crontab. The variables set in a crontab only apply in this crontab, so the settings in /etc/crontab have no influence on the job executed by root's crontab.
The default shell in Cron is /bin/sh, and the SHELL environment variable is set to /bin/sh unless overridden. So Tmux starts with SH... | How to make my tmux which starts via crontab @reboot use bash? |
1,390,493,252,000 |
I accidentally wreaked unknown amounts of havoc on my web server by running
sudo chown -R myuser:mygroup * .*
in /var/www, not remembering that .* would include the parent directory (as ..). I realized what was happening after a second or so, but by then it was too late, half the directories in /var had been "re-owne... |
Well, "/var" is generally for data generated by programs, so it may not be possible to tell you exactly who should own what without duplicating your system. I can think of two ways you might fix it:
Set up another version of your web server on a spare or virtual machine and then check /var.
Just change to root/root ... | What files in /var need to have specific owners? |
1,390,493,252,000 |
Is it possible to change the default message broadcasted by shutdown to something else?
|
As @Zelda mentioned the messages are hardcoded. If you want to change it beyond amending the message with additional bits:
$ sudo shutdown -h +120 Save your work.
You'll need to recompile shutdown, creating your own executable that includes the customized message.
For example, here's a sample source file, shutdown.c.... | Changing shutdown broadcast message |
1,390,493,252,000 |
I'm on Linux Mint Olivia. I just installed Lynx.
How do I set Lynx as my browser, so when I open links from the terminal, they open in that terminal with Lynx?
|
First make .desktop application for lynx:
[Desktop Entry]
Type=Application
Name=Lynx
Exec=gnome-terminal -e 'lynx %u'
And save it to application directory e.g /usr/share/applications/ naming like lynx.desktop and give it execution permission (chmod +x /usr/share/applications/lynx.desktop).
Then set it as default web ... | Change default web browser to lynx from terminal |
1,390,493,252,000 |
I have hosts, where I can setup application on a single node architecture or distributed.
So I have an inventory.
[STG]
node1
[LIVE]
app_node
db_node
gateway_node
So a variable with default value be single but can be changed on CLI to distributed.
I have a role definition
- hosts:
gather_facts: no
roles:
-... |
There are more options:
Put the logic into the expression of hosts:
shell> cat pb.yml
- hosts: "{{ (map_value == 'single')|ternary('STG', 'LIVE') }}"
tasks:
- debug:
var: ansible_play_hosts
run_once: true
gives what you want
shell> ansible-playbook pb.yml -e map_value=single
PLAY [single] *****... | Is it possible to specify hosts for an Ansible role based on a map value? |
1,390,493,252,000 |
Similar to this question, I have some applications (Calibre, texdoc) open PDFs with Mendeley. Opening PDFs from Thunar, Thunderbird, Firefox etc. opens evince, the expected default.
It seems that those applications use xdg-open since:
$ xdg-mime query default application/pdf
mendeleydesktop.desktop
I tried to find wh... |
The question remains: where did xdg-open get the idea that Mendeley should
be the default PDF viewer from?
This is an eminently reasonable question.
Here's a somewhat long answer in three parts.
Option 1: read the documentation
For example, the FreeDesktop standard
on mimetype associations has this to say:
Associat... | Why does xdg-open use Mendeley as default for PDFs? |
1,390,493,252,000 |
I'm trying to set the default g++ to 4.7.2 which I'm told by my host is installed (I'm also told that c++11 is also installed); however, neither of us know how to set the default g++ to 4.7.2 because g++ --version gives
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This ... |
You need to set the CXX environment variable. For example, export CXX="/usr/bin/g++-4.7" . And CC is the one that controls the C compiler.
| set default g++ on CentOS? |
1,390,493,252,000 |
One of the most common recommendations that I read for users that recently installed Linux Mint is to enable their firewall, which is pretty simple to do. But why is the firewall off by default in the first place? Is there any reason for this?
|
Link Mint is an Ubuntu-based distribution intended for desktop systems. One of its chief priorities is "ease of use" so a firewall just puts into play something that could break things for users. It's easier if the firewall only gets turned on if the operator is someone who knows what such a thing even is versus a nov... | Why is the firewall off by default with Linux Mint? |
1,390,493,252,000 |
I have recently switched to Gnome 3 from Gnome 2 (and switched to Linux recently before that), and Gnome 3 doesn't give me as many options to change settings via the GUI, and especially not to change default settings.
Specifically, I'm trying to change the lid close action on my laptop, since I don't want it to suspen... |
Eureka!
Thanks to a combination of the answers here, a discussion about setting the login screen's wallpaper, and a general discussion about running an X program from another console, I finally managed to solve this.
I do need to set the setting as the gdm user. But, simply running gsettings set ... as gdm will fail b... | Set Default/Global Gnome Preferences (Gnome 3) |
1,390,493,252,000 |
I want to add a few directories to the skeleton directory. When I add new user I want to add my own directories to the new home directories.
|
As thrig pointed out, all that's needed is to create the directory structure that you want under /etc/skel.
Quoting from the useradd man page
-k, --skel SKEL_DIR
The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by useradd.
Thi... | Skeleton directory - how to add my own directories |
1,390,493,252,000 |
I just switched to OpenSUSE (KDE) from my Fedora 20 KDE setup,and I find myself greatly missing a feature that was a default in Fedora: a "Recently Used" option in the file manager when saving and uploading files. As far as I can tell, both are using Dolphin, but the appearance is inconsistent. I still see something l... |
You can add this entry manually: right click on the Places, choose Add Entry, enter this in Location field: recentdocuments:/// and save it. It should be available now in all KDE/Qt file dialogs.
| Get "recent files" in global file manager (Dolphin?) |
1,390,493,252,000 |
What is the count default in dd command if not specified ?
dd if=/dev/mem bs=1k skip=768
instead of full form like
dd if=/dev/mem bs=1k skip=768 count=50
I did not find an answer with Google.
|
The default is unlimited - keep going until you run out of space.
| dd count default |
1,390,493,252,000 |
I'm running FreeBSD 9.1-RELEASE. I've installed GNU grep with portmaster textproc/gnugrep.
However the "default" grep for users is still FreeBSD grep.
# /usr/local/bin/grep -V
/usr/local/bin/grep (GNU grep) 2.12
# grep -V
grep (GNU grep) 2.5.1-FreeBSD
I want to make GNU grep the default. I understand that the proble... |
Update: Note this answer is from 2013, it applies to FreeBSD 8.x and earlier. A BSD grep was added in revision 222273 and appeared in FreeBSD-9.0 (oddly that change is missing from the usually comprehensive release notes: Google search). A fully-featured GNU grep continues to be available in the ports collection.
Fre... | How to make GNU grep the default in FreeBSD? |
1,390,493,252,000 |
Actually, I think my question is too basic, but, even after performing a deep search on internet, I still didn't understand how a browser selects a particular font for rendering a particular script on Linux systems. I know that Linux systems have fontconfig for managing font rendering in applications, but the behaviou... |
After a long time of studying the behavior of fontconfig and browsers, I came to know these points :
Fontconfig is comparatively small, but complex piece of software. It has an algorithm that matches the best font for given conditions and rendering parameters. These conditions and parameters are collectively known as... | Browser's Mechanism of font choosing on Linux Systems |
1,390,493,252,000 |
While writing shell scripts, in order to achieve as much portability as possible, one might want to try and stick to using command line tools that are likely to be already installed on target systems.
We can evaluate for specific tools, as in this example:
Are there versions of Unix that don't have awk in default inst... |
Anything that can reasonably called Unix or Unix-like has POSIX utilities. You can generally assume that the utilities are present, that they support the listed options, and that they behave as indicated. There are a few limitations:
Features that are marked as optional may not be present everywhere.
Recently added f... | Set of CLI tools that are installed by default on most distributions |
1,390,493,252,000 |
I'm running Ubuntu 20.04. I just downloaded Awesome and I'd like to start running it by default. I tried to open Awesome on the command line and received the message E: awesome: main:772: another window manager is already running (can't select SubstructureRedirect). What does this mean/how can I set up Awesome as the ... |
You have to select it from the display manager aka lock screen, if you use gnome click on the top right corner and then click log out, after you log out select your user but before you enter your password, click the gear at the lower right of the screen, a menu will appear, select awesome, after that you can input you... | How to set Awesome as the default WM in Ubuntu 20.04 |
1,390,493,252,000 |
Inside my bash script:
This works:
CWD="${1:-${PWD}}"
But, if I replace it with:
CWD="${1:=${PWD}}"
I get the following error
line #: $1: cannot assign in this way
Why I can't assign to ${1}?
|
From bash's manpage:
Positional Parameters
A positional parameter is a parameter denoted by one or more digits,
other than the single digit 0. Positional parameters are assigned from
the shell's arguments when it is invoked, and may be reassigned using
the set builtin command. Positional paramet... | Bash: Error in assigning default value to a variable |
1,390,493,252,000 |
DeadBeeF has a new option, 'Designer mode' allowing to modify the displayed features, modules, addons, in the way Foobar2000 is doing by its layout editing mode.
Example of difficulty:
All the interface can be modified, you may end up with no interface at all or you may find it hard to restore the default one.
Af... |
Try going to /home/$USER/.config/ and remove the whole deadbeef config folder to reset. Save that file to backup configuration.
| How to save customized interface of DeadBeef? |
1,390,493,252,000 |
I'm using Debian 7.5, and I've installed Python 3.3 and 3.2. How do I make 3.3 the default for when someone types python in the command line?
|
To change the version of python that is executed when you type python on the command line, and only then, define an alias in your shell initialization file (the one for interactive shells). This is ~/.bashrc for bash, ~/.zshrc for zsh, ~/.cshrc for csh, ~/.config/fish/config.fish for fish. Use the correct path for Pyt... | How to change the default version of Python in Debian 7.5? |
1,469,148,183,000 |
I've installed windows 7 and linux dualboot. My partitions are:
/dev/sda2: UUID="EC328C61328C329E" TYPE="ntfs"
/dev/sda3: UUID="800E88610E8851D8" TYPE="ntfs"
/dev/sda4: UUID="20e7c430-bab0-4aa1-8afe-caa9d97e1de3" TYPE="ext4"
where sda2 is windows sda3 is shared partition and sda4 is linux
sd3 has mounting point /wi... |
Keep the lines as they were in original user-dirs.dirs :
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
And now create symbolic links to point to your windows folders (make sure you have no important data in the three concerned folders :
cd ~
rm -fr Music Pictures Videos... | Redirect home to shared NTFS partition |
1,469,148,183,000 |
There are many Clipboard Manager for Unix-based Operating System but is there a way to actually know which one is being used?
I am on Fedora 20 under Gnome 3.10.1 and I know that I'm using GPaste 3.10.
But I would like to know if there is a command line which would ouput GPaste 3.10 (except gpaste --version obviously... |
After doing an extensive search I wasn't able to find a method for doing this. So it would seem impossible to find out what downstream tools are collecting the results of the clipboards in an attempt to provide a "management" facility around them.
| Knowing default clipboard manager |
1,469,148,183,000 |
Prompted for a system password on an AntiX Live USB/CD and it's not root...
|
AntiX's default password is demo
| What is AntiX's root default password? |
1,469,148,183,000 |
I often attach files when on the web (using Chrome/Firefox), or when using email (Thunderbird). I need to navigate to a specific folder, and there I often need one of the most recent files.
However, Thunar always resets the "Order by" column to "Name", so for every single attachment I need to re-order the column. Thi... |
$EDITOR .config/gtk-2.0/gtkfilechooser.ini
You are looking for the line SortColumn and SortOrder
SortColumn=modified
SortOrder=descending
should give you what you are trying to achieve.
| Have Thunar remember file ordering for folders |
1,469,148,183,000 |
When I right click an mkv file in file browser and select 'Open With' I see the list:
Dragon Player
VLC Media PLayer
When I double click it, it launches the file in Dragon Player. I'd like to change that so that it launches in VLC Media Player as the default double-click action. Where do I set that?
I looked in Set... |
You can right click -> properties -> file type options and edit, delete, reorder or add the entries, which will appear in the "open with" dialog.
You can access this same dialog via `System Settings -> File associations
| How can I prioritize 'open with' apps in KDE? |
1,469,148,183,000 |
I just downloaded opera-stable_56.0.3051.99_amd64.deb from https://www.opera.com/de/download
and ran
sudo dpkg -i opera-stable_56.0.3051.99_amd64.deb
It complained about some missing dependencies so I ran
sudo apt-get -f install
sudo apt install apt-transport-https
then reran
sudo dpkg -i opera-stable_56.0.3051.99... |
When installing software, always use the same methodology to remove said software as you've installed it with... (true on any OS) 0:-)
Therefore it's always a good idea to install from Debian pre-packaged repositories until you have a bit more experience. ;-)
In this case, to uninstall opera:
sudo dpkg --remove opera... | Opera browser set itself as default without asking! |
1,469,148,183,000 |
I have a Debian workstation with two interfaces: the ethernet jack attached to the motherboard (eth0), and a USB to ethernet adapter (eth6). eth0 connects to the internet, while eth6 connects to some special equipment only accessible over ethernet.
When the workstation starts, it connects to eth6 by default; when this... |
You just need to set the default gateway to the correct interface.
It should be configured in your GUI (Network Manager for example) or if you feel a bit geeky, you can configure it in your /etc/network/interfaces
This is a minimal configuration example for your /etc/network/interfaces file:
auto eth0
iface eth0 inet... | Setting default network interface? |
1,469,148,183,000 |
I am thinking about doing an Ubuntu installation with their mini ISO, which comes only with the barebones system without a desktop environment/GUI.
I remember being given the option to set up automatic login when doing a full Ubuntu desktop installation, but how to I enable that for the mini ISO install? Did I miss so... |
You might find some ideas in this thread of linuxquestions.org
| Auto login for Ubuntu (or other Linux) without GUI? |
1,469,148,183,000 |
What's the difference between apt install php and apt install php-defaults?
In a first glimpse I would theorize that php should include everything default for a (latest) php program.
I ask this as a follow up to this question.
|
The difference is that
apt install php-defaults
doesn’t work, because php-defaults is a source package, not a binary package.
A source package contains the source code and packaging descriptors used to build one or more binary packages. Source packages aren’t directly installable.
| apt: What's the difference between "apt install php" and "apt install php-defaults"? |
1,469,148,183,000 |
I want to create a directory where multiple users will be able to contribute to the same files and I want each file that any user creates to have write permission by default for everyone in the group.
I did setgid for a directory and all new files have the right group. However new files are still created without write... |
Default permissions for new files and folder are determined by umask. If you configure the default umask for your users to 002, group permission will be set to rw for new files and folders. Configuring umask for all users can be done using pam_umask.
To use pam_umask, on Debian based distributions you should configure... | Auto set write permission for a group |
1,469,148,183,000 |
defaults read -g AppleLanguages
produces something like this:
(
en,
de
)
I'd like to extract just the first element, in this case "en",
defaults read -g AppleLanguages | awk '/\(/ , /,/'
but awk always includes the search patterns. What can I do to produce just "en"?
|
You could just print the second line. You can use many tools for this:
sed
defaults read -g AppleLanguages | sed -n '2s/,//p;' file
Explanation: The 2 means "run the following commands only on the second line". The -n suppresses normal output (nothing is printed unless explicitly told to do so). The substitution (s... | read first element in array |
1,469,148,183,000 |
I built emacs 24.3 from source on OS X 10.8 and when I attempt to set the default font with
Options -> Set Default Font -> [font]
My choice is not saved next time I open emacs.
I'm attempting to use misc->6x13
|
That's expected behavior: this menu only changes options for the current instance of Emacs. The Options menu mostly provides quick access to some options that people commonly change mid-session.
To make permanent changes, open the Customize interface from the Options menu. Go to “Emacs” (the toplevel customization dia... | Setting default emacs font not saving (built from source OS X 10.8) |
1,469,148,183,000 |
I'm on Lubuntu 20.04, with no PulseAudio installed. I'm having some trouble editing my ALSA setting, as any change I make interferes with my microphone.
In particular, if I use the following basic configuration file:
pcm.!default {
type hw
card 2
}
ctl.!default {
type hw
card 2
}
Then I am unable to ... |
The default definition of the default device can be found in /usr/share/alsa/pcm/default.conf. If it does not redirect to a driver-specific default, it is defined like this:
pcm.!default {
type plug
slave.pcm {
type hw
card 2
}
}
The plug plugin implements automatic sample rate/format conv... | What exactly is the default pcm ALSA device? |
1,469,148,183,000 |
I understand from Richard Stallman in this video, made probably in 2012/2013, that Ubuntu isn't 100% free by the GNU organization definition of Free Software, as according to Stallman there, it "spies" on users and also share the "spied" information with Amazon.
I asked about it in AskUbuntu but my question was putted... |
This was a feature provided by Unity’s shopping lens; it was removed in Ubuntu 17.10, and was never available in Debian.
| Does the search tracking and Amazon information sharing attributed to Ubuntu part of Debian? |
1,469,148,183,000 |
I'm using LC_TIME="en_AU.UTF-8" in general, and I'm happy with that. However, when I use Thunderbird, I'd like it to use a 12-hour clock. I've created a custom locale, and it works fine if I launch Thunderbird with
LC_TIME=en_AU_12h.utf8 /usr/bin/thunderbird
However, can I make Thunderbird launch like this by default... |
The usual way is to create a script which calls the binary as part of the script. Then you can just set the variables in the script. In fact, it is not uncommon for executables corresponding to complex programs to be set up like that. E.g. chromium. So, if /usr/bin/thunderbird isn't already a script (check) you can cr... | How can I consistently set an environment variable for a single program? |
1,469,148,183,000 |
If /etc/sysconfig/network-scripts/eth0 does not include any NM_CONTROLLED setting on a RHEL-based distribution, what's the default behaviour?
Is there any difference in the default setting between RHEL5/6/7?
|
Actually only NM_CONTROLLED="no" (or is it "false" ?) does anything.
Putting "yes" (or is it "true" ?) is the same as not having the line at all:
for network devices supported by NetworkManager it will manage them; for those unknown to NetworkManager it will ignore them anyway.
| RHEL5/6/7 : If NM_CONTROLLED is not set what is the default value? |
1,469,148,183,000 |
I looked through this question about setting the default pdf reader to evince. None of it seems to help for my install of debian 10.3 with the cinnamon desktop. I had a poke around and could find this:
$ cat /usr/share/applications/x-cinnamon-mimeapps.list | grep pdf
application/pdf=evince.desktop;
application/x-ext-p... |
If you by double click on a pdf mean opening it from the file manager, than which manager are you using? They can have their own mime-type handling, and for example, in Nautilus you can change it by clicking on the file with the right button, opening properties, selecting Open with tab and setting your application as ... | set default pdf reader in debian 10 buster with cinnamon desktop |
1,469,148,183,000 |
# ...
def show():
"""
Show image
"""
t = Twitter(auth=authen())
try:
target = g['stuff'].split()[0]
if target != 'image':
return
id = int(g['stuff'].split()[1])
tid = c['tweet_dict'][id]
tweet = t.statuses.show(id=tid)
media = tweet['enti... |
Under the hood, PIL defaults to using the display command provided by ImageMagick to display image (or xv, if exists). If you want to open an image with other program, you might have to modify PIL's source, and here is how.
| Change default image viewer |
1,469,148,183,000 |
Topic is the question.
Requirements:
FOSS of course
Independant of desktop environments
is compliant with the Association between MIME types and applications standard
Has optionally a neat GUI (my application uses mimeapps.list and I want to refer my user to a userfriendly way to change default apps)
|
Found the cli tool. A GUI would still be nice to have...
$ xdg-mime query filetype foo.jpg # Get the mimetype of the file
image/jpeg
$ xdg-mime default gwenview.desktop image/jpeg # Set a new association
| Is there an xdg comliant DE independant "default-aplication-setter application"? |
1,469,148,183,000 |
I have installed pycharm via flatpak on linux Mint 21.1. I want to open every .py file in the PyCharm application. But when I right click and choose "open with other application" PyCharm is not on the list.
How can I set PyCharm to be default app for .py files ?
Thank you for help
EDIT:
I found .desktop file in /home... |
Solution was to go to:
/var/lib/flatpak/exports/bin/
where I found this:
lrwxrwxrwx 1 root root 105 Jan 7 13:28 com.jetbrains.PyCharm-Professional -> ../../app/com.jetbrains.PyCharm-Professional/current/active/export/bin/com.jetbrains.PyCharm-Professional
So I set up default aplication to:
/var/lib/flatpak/exports... | How to set application installed via flatpak as default aplication for some type of files? |
1,469,148,183,000 |
Normally when I make a directory with mkdir the permissions I expect are 751 or 755. However for some reason when new files are created, even in a users home directory, they are set to 700.
What controls the default permissions on new files and what kind of configuration change led to this happening?
|
As @Tejas mentioned, you need to understand umask and its values for changing the default permissions.
I recommend you read this article so you'll understand how to use it properly.
In addition, you should know that it's not permanent, so after rebooting your system the umask value you've set will be gone. To set it i... | What do are group permission missing on new directories? |
1,469,148,183,000 |
Is there a way to set default options for cryptsetup? For example, lets say I want to make sure that I only open cryptsetup devices with the -r option. I would like to add it to a config file, so that I don't have to type it every time (and potentially forget it)
Reading man cryptsetup did not reveal any information.
|
AFAIK there is no configuration file for cryptsetup. You can of course define an alias and put that somewhere where it gets read in at login:
alias cryptsetup='cryptsetup --readonly'
| setting default options for cryptsetup |
1,469,148,183,000 |
I'm using gnu make and stow to manage some configurations (dotfiles).
I have multiple directories in my repo:
dotfiles/
├── Makefile
├── package1/
└── package2/
Currently, my Makefile looks like:
PACKAGES = package1 package2
.PHONY: all $(PACKAGES)
all: $(PACKAGES)
package1:
stow --no-fold $@
package2:
st... |
You could replace your rule with:
$(PACKAGES):
stow --no-fold $@
| Make pattern match directories |
1,469,148,183,000 |
I have a Linux device that utilizes USB gadget for RNDIS support. The goal was to be able to connect any computer this device without having to mess with IP settings. I've set a static IP address on my RNDIS device. As far as communication goes, everything works. What does not work is my host PC seems to add my RNDIS ... |
The RNDIS device may have static IP address, but where and how does the host PC get the IP address settings for connecting to the RNDIS device?
If the RNDIS device provides the settings for the host, using DHCP, PPPoE or some other mechanism, then the RNDIS device should not provide a default gateway setting if it is ... | RNDIS interface gets a gateway |
1,469,148,183,000 |
How do I set the default folder order in Gnome? I'm talking about setting 'type order' as default so the folders will always be listed at the top, and other files after them.
Here is the image:
You see that everything is listed by the type, and I want this to be the default order so when I reboot, it won't reset.
|
you will be able to achieve this by opening nautilus preferences as follow:
open a nautilus window > click on "files" from top menu > preferences (as showed here)
And then from there setup the Default view. Specifically Arrange items: by type
| Default Folder Order in Gnome |
1,371,822,060,000 |
Is there a command to recover/undelete deleted files by rm?
rm -rf /path/to/myfile
How can I recover myfile? If there is a tool to do this, how can I use it?
|
The link someone provided in the comments is likely your best chance.
Linux debugfs Hack: Undelete Files
That write-up though looking a little intimidating is actually fairly straight forward to follow. In general the steps are as follows:
Use debugfs to view a filesystems log
$ debugfs -w /dev/mapper/wks01-root
A... | Recover deleted files on Linux |
1,371,822,060,000 |
Is there a simple option on extundelete how I can try to undelete a file called /var/tmp/test.iso that I just deleted?
(it is not so important that I would start to remount the drive read-only or such things. I can also just re-download that file again)
I am looking for a simple command with that I could try if I mana... |
Looking at the usage guide on extundelete it seems as though you're limited to undeleting files to a few ways.
Restoring all
extundelete is designed to undelete files from an unmounted partition to a separate (mounted) partition. extundelete will restore any files it finds to a subdirectory of the current directory n... | undelete a just deleted file on ext4 with extundelete |
1,371,822,060,000 |
Hi I have many files that have been deleted but for some reason the disk space associated with the deleted files is unable to be utilized until I explicitly kill the process for the file taking the disk space
$ lsof /tmp/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
cron 1623 root 5u REG 0,... |
On unices, filenames are just pointers (inodes) that point to the memory where the file resides (which can be a hard drive or even a RAM-backed filesystem). Each file records the number of links to it: the links can be either the filename (plural, if there are multiple hard links to the same file), and also every time... | Best way to free disk space from deleted files that are held open |
1,371,822,060,000 |
Never thought this would happen to me, but there you go. ¯\_(ツ)_/¯
I ran a build script from a repository inside the wrong directory without looking at the source first. Here's the script Scripts/BuildLocalWheelLinux.sh:
cd ../Dependencies/cpython
mkdir debug
cd debug
../configure --with-pydebug --enable-shared
make
c... |
Ouch. You aren't the first victim.
What went wrong?
Starting in your home directory, e.g. /home/felix, or even in /home/felix/src or /home/felix/Downloads/src.
cd ../Dependencies/cpython
Failed because there is no ../Dependencies.
mkdir debug
cd debug
You're now in the subdirectory debug of the directory you sta... | I just deleted everything in my home directory. How? And why are some files still there? |
1,371,822,060,000 |
I use RHEL4 with LVM2 on it. At times even after removing large files more than a GB, the partition size is not getting updated when using the df command.
-bash-3.00$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/sys-root 3.9G 1.4G 2.3G 39% /
/dev/cciss/c0d0p1 251M 19M 219M 8% /... |
When a file is removed/deleted/unlinked, if it is still held open by any process then only the directory entry for the file is erased, not the file's data. When the file is completely closed by all processes the data is returned to the free space pool. It's a feature since you can have anonymous files this way.
To s... | Updating disk free size without rebooting the host |
1,371,822,060,000 |
I was looking at the man page for the rm command on my MacBook and I noticed the the following:
-W Attempt to undelete the named files. Currently, this option can only be used to recover
files covered by whiteouts.
What does this mean? What is a "whiteout"?
|
A whiteout is a special marker file placed by some "see-through" higher-order filesystems (those which use one or more real locations as a basis for their presentation), particularly union filesystems, to indicate that a file that exists in one of the base locations has been deleted within the artificial filesystem ev... | macOS rm command '-W' option - undelete |
1,371,822,060,000 |
One program created lots of nested sub-folders. I tried to use command
rm -fr * to remove them all. But it's very slow. I'm wondering is there any faster way to delete them all?
|
The fastest way to remove them from that directory is to move them out of there, after that just remove them in the background:
mkdir ../.tmp_to_remove
mv -- * ../.tmp_to_remove
rm -rf ../.tmp_to_remove &
This assumes that your current directory is not the toplevel of some mounted partition (i.e. that ../.tmp_to_remo... | What's the fastest way to remove all files & subfolders in a directory? [duplicate] |
1,371,822,060,000 |
I accidentally changed all the contents of the .bashrc file and I haven't scripted it yet so there's no problem for now. I added little scripts to it (just a few alias), so I can write them again one by one.
How can I restore my .bashrc file with the default settings?
I use Linux Mint.
|
There exist backup copies of .bashrc, .profile etc. in /etc/skel/. So one could replace a corrupt .bashrc simply by overwitting from there.
How do I restore .bashrc to its default?
cp /etc/skel/.bashrc ~/
| How can I restore my default .bashrc file again? |
1,371,822,060,000 |
I have a VPS I'm planning to delete. This particular cloud provider makes no guarantee that the data on the drive will be wiped before giving the disk to the next person. What's a best effort attempt I can make to secure-wipe sensitive data (whether existing as files or as deleted data) on the drive?
Assume the provi... |
Use the scrub command1 on the user data portions2 of the VPS filesystem.
BEWARE: The following commands purposely destroy data.
Here is a list of ideas for scrubbing targets, in a sensible order, but you may need to vary it for your particular VPS configuration:
Databases, typically stored under /var. For instance, i... | Secure wipe (scrub) filesystem of VPS from VPS itself |
1,371,822,060,000 |
I have a process running very long time.
I accidentally deleted the binary executable file of the process.
Since the process is still running and doesn't get affected, there must be the original binary file in somewhere else....
How can I get recover it? (I use CentOS 7, the running process is written in C++)
|
It could only be in memory and not recoverable, in which case you'd have to try to recover it from the filesystem using one of those filesystem recovery tools (or from memory, maybe). However!
$ cat hamlet.c
#include <unistd.h>
int main(void) { while (1) { sleep(9999); } }
$ gcc -o hamlet hamlet.c
$ md5sum hamlet
3055... | How to recover the deleted binary executable file of a running process |
1,371,822,060,000 |
I have an hourly hour-long crontab job running with some mtr (traceroute) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far.
On Linux, I have used lsof -n | fgrep cron (lsof is similar to BSD's fstat), and it seems like ... |
The file can be access through the /proc filesystem: you already know the PID and the FD from the lsof output.
cat /proc/21742/fd/5
| How can I access a deleted open file on Linux (output of a running crontab task)? |
1,371,822,060,000 |
I started downloading a big file and accidently deleted it a while ago. I know how to get its current contents by cping /proc/<pid>/fd/<fd> but since the download is still in progress it'll be incomplete at the time I copy it someplace else.
Can I somehow salvage the file right at the moment the download finishes but ... |
Using tail in follow mode should allow you to do what you want.
tail -n +0 -f /proc/<pid>/fd/<fd> > abc.deleted
I just did a quick test and it seems to work here. You did not mention whether your file was a binary file or not. My main concern is that it may not copy from the start of file but the -n +0 argument shoul... | Recover deleted file that is currently being written to |
1,371,822,060,000 |
In the first terminal A, I create a directory, enter the directory, and create a file:
$ mkdir test
$ cd test
$ touch file1.txt
$ ls
file1.txt
Then in another terminal B, I delete the directory:
$ rm -r test
$ mkdir test
$ cd test
$ touch file2.txt
And back again the terminal A (not doing any cd), I try to list the ... |
How comes that ls doesn't see the problem?
There is no "problem" in the first place.
something is not right in the terminal A
There is nothing not right. There are defined semantics for processes having unlinked directories open just as there are defined semantics for processes having unlinked files open. Both a... | What happens when the current directory is deleted? |
1,371,822,060,000 |
I'm setting up an automation process where I am deleting files in a directory which contains sub-directories. I only want to delete the files in the directory, and want to keep the sub-directories intact. So right now I am just using rm * to delete the files in that directory. However, this command throws the messa... |
You can just throw away the error messages:
rm * 2>/dev/null
That'll throw away all errors. If you want to see other potential errors then we can do something more complicated:
rm * 2>&1 | grep -v 'cannot remove .*: Is a directory'
In this way other errors will still be logged.
| Ignore 'cannot remove `dir`: Is a directory message |
1,371,822,060,000 |
Accidentally a rm -rf command was launched to my root directory instead of current directory. I stopped file removing by Ctrl+C but some files has already been removed. Is there a LINUX command to list all recently removed files from the system to get the affected applications ?
Operating System: CentOS 6.3
|
*nix systems typically have a locate utility installed. It has a database, usually updated nightly, that has the names of (almost) all files on your system. Just run:
locate /path/to/dir/of/interest
and you should see a list of files that were in that directory as of the last database update. You can diff this aga... | Is there a UNIX command to list all recently removed files from a system |
1,371,822,060,000 |
I am using RHEL8, and I see the directory - ~/.local/share/Trash/files
And there were so many files in it. Looking at the name and files present there it gave me an intuition that it is similar to recycle bin of Windows OSes.
Just tried playing around with it, and appeared like the files deleted through File manager o... |
This is used by programs which comply with the FreeDesktop.org Trash specification. rm doesn’t follow this specification, but many current desktop environments do: instead of deleting files outright, they move them to the appropriate trash directory, thus allowing them to be “undeleted” if necessary.
On the command-li... | Is ~/.local/share/Trash/files used by GNOME only for deleted files and not by rm command? |
1,371,822,060,000 |
I had a file with symbolic link
link -> original_file
original_file
I mistakenly ran unlink command with original_file
Now the original file is missing and the symbolic link is broken. What to do? How to recover the original file?
|
As the man page specifies, the unlink command will remove a specified file :
UNLINK(1)
NAME
unlink - call the unlink function to remove the specified file
Unlink will remove hard-links and symbolic-links as well.
As a file in Linux is a hard-link to an inode, if a regular file is specified as a parameter, this h... | unlink original file instead of symbolic link. What to do? |
1,371,822,060,000 |
SERVER:~ # df -mP /home/
Filesystem 1048576-blocks Used Available Capacity Mounted on
/dev/mapper/rootvg-home_lv 496 491 0 100% /home
SERVER:~ #
SERVER:/home # lsof | grep -i deleted | grep -i "home" | grep home
badprocess 4315 root 135u REG 253,2 133525523 61... |
You can use the entries in /proc to truncate such files.
# ls -l /proc/4315/fd
That will show all the files opened by process 4315. You've already used lsof and that shows that the deleted file is file descriptor 135, so you can free the space used by that deleted file as follows:
# > /proc/4315/fd/135
The same goes... | How to reclaim storage of "deleted", but still used files on Linux? |
1,371,822,060,000 |
Using Linux Mint with Cinnamon.
I deleted some files using ShiftDel, so that they wouldn't go to the trash, but hoping they would be deleted immediately. However, the files are still there, they have only been renamed with a ~ at the end, making them invisible, but are not gone.
If I were to delete the tilde from th... |
The setting that controls immediate deletion is available in dconf-editor.
org nemo preferences enable-delete.
Even though the default setting is enabled it didn't work correctly. I disabled it and re-enabled it again, and now ShiftDel works as expected: Files-be-gone-for-good...
| How to fully delete files bypassing the trash? |
1,371,822,060,000 |
I've noticed, if a file is renamed, lsof displays the new name.
To test it out, created a python script:
#!/bin/python
import time
f = open('foo.txt', 'w')
while True:
time.sleep(1)
Saw that lsof follows the rename:
$ python test_lsof.py &
[1] 19698
$ lsof | grep foo | awk '{ print $2,$9 }'
19698 /home/bfernandez... |
You are right in assuming that lsof uses the inode from the kernel's name cache. Under Linux platforms, the path name is provided by the Linux /proc file system.
The handling of hard links is better explained in the FAQ:
3.3.4 Why doesn't lsof report the "correct" hard linked file path
name?
When lsof reports... | How does `lsof` keep track of open file descriptors' filenames? |
1,371,822,060,000 |
I was trying to get SFML working on fedora 24, and I accidentally deleted the usr/include directory in the process. Is there any way to reinstall all the missing files? Or do I have to reinstall the whole OS? I have tried running sudo dnf --exclude=kernel\* reinstall \* and it seemed to fix some of the problem but I a... |
You can make a list of the packages whose include-files are missing by using the "verify" feature of rpm.
Something like this:
#!/bin/sh
rpm -qa|while read name
do
include=$(rpm -ql "$name" |grep -E '^/usr/include/' |wc -l)
[ $include = 0 ] && continue
missing=$(rpm -V "$name" |grep -E '^missing[[:space:]]... | Accidentally deleted /usr/include. What can I do to reinstall the files that were in that directory? |
1,371,822,060,000 |
I have an old log that stays in (deleted) state, and after applying
> /proc/'pid'/fd/4 the space is not reclaimed.
In fact, the size of file is zeroed, but the space is still used ?
Have I forgotten something ? Do I have to perform unlink of some sort ?
lr-x------ 1 root root 64 Mar 10 16:11 4 -> /var/app/logs/app.lo... |
In fact the space is reclaimed by the filesystem, but the size of the file is only temporarily reduced to 0 until the next write by the process that still has the file open. At that point the size is increased to the previous size, plus the newly written data, but you now have a sparse file, where the start of the fil... | Free space not reclaimed after truncating the fd |
1,371,822,060,000 |
Apparently on a production server there has been some problem and someone has deleted the contents of the /var folder.
This has caused several errors that I have been solving with various services as a web server.
The problem I'm having with apt, problem that doesn't allow me to update, remove or install packages.
fo... |
I will be referencing the following article and Debian Wiki post for my answer.
First, on a working Raspbian system, create a debootstrap environment. Following the instructions from the Debian Wiki you would only need to complete the following:
mkdir /debootstrap
debootstrap stable /debootstrap http://deb.debian.org/... | Problems with apt in Raspbian where /var content has been removed or corrupt |
1,371,822,060,000 |
I started a very long running job (expected to take 6 days to finish), and want to see its output, so I did:
$ nohup ./thejob.sh > out.txt
When I need to see the job progress I tail - f the file.
but the out.txt file was growing too much and I deleted the file and created it again.
$ rm out.txt
$ touch out.txt
After... |
The old file isn't yet gone, and you could access it if you know the PID of the process writing to it. You can go to /proc/<pid>/fd and look at 1 which is it's stdout
This also means, though, that you haven't reclaimed any space from trying to remove the file.
Also, once the process exits, the file will be removed.
| How to see the contents of a file I deleted, but that a process is still writing to |
1,371,822,060,000 |
I hadn't sleep much. A bad script was creating a folder under somewhere/~ and I tried to removed it with rm -rf ~.
I Ctrl C quickly and I don't think I've lost much files. I get they are lost for good. Is there still a way to get a list of the files that got removed?
|
I Ctrl C quickly and I don't think I've lost much files. I get they are lost for good. Is there still a way to get a list of the files that got removed?
There is no easy way to "list" what you have deleted. You could do an extundelete /dev/home_partition(sdx) --restore-all to try to recover your data, or follow this... | Get list of files deleted by rm -rf |
1,371,822,060,000 |
I was wondering is there any way to delete all the files in the destination using rsync which are found in source. I have 30+ dir in source and 100+ files on the destination
I want only the 30+ in the destination to be delete recursively wondering if rsync or any other would help me do that...
Source
a/
b/
c/
destin... |
I don't think that rsync can do that, but you can make a list of files, modify that list and copy it as a script to the destination.
Assuming that your file names don't contain newlines or single quotes ('), run this on the source machine:
cd basedir
find . -type f | sed 's/^/rm -f '\''/' | sed 's/$/'\''/' > /var/tmp/... | Delete the files on the destination which are found in the source using rsync |
1,371,822,060,000 |
I'm interested in accurately removing a git repository in a reasonable time.
But it takes quite a while to do so. Here, I have a small test repo where the .git folder is < 5MiB.
$ du -ac ~/tmp/.git | tail -1
4772 total
$ find ~/tmp/.git -type f | wc -l
991
Using shred's default options, this takes quite long. In t... |
Forget about shred, it spends a lot of time doing useless things and misses the essential.
shred wipes files by making multiple passes of overwriting files with random data (a “Gutmann wipe”), because with the disk technologies of 20–30 years ago and some expensive laboratory equipment, it was possible (at least in th... | How can I shred a git repository, reasonably fast? |
1,371,822,060,000 |
In the process of trying to fix an issue, I accidentally deleted /sbin/sysctl when I was intending to delete /etc/sysctl.conf.
When I run sysctl I get the error that says
The program 'sysctl' is currently not installed. You can install it by typing:
sudo apt-get install procps
When I try both install and upgrade it... |
You can use the --reinstall flag to apt-get
apt-get --reinstall install procps
| Restore part of a package that was accidentally deleted |
1,371,822,060,000 |
I have executed rm -f *.gz about 30 days ago. Is there any way to find out the list of files that were deleted?
|
You can use the debugfs utility,
debugfs is a simple to use RAM-based file system specially designed
for debugging purposes
First, run debugfs /dev/sda2 in your terminal (replacing /dev/sda2 with your own partition).
Once in debug mode, you can use the command lsdel to list inodes corresponding with deleted files.... | View list of deleted files |
1,371,822,060,000 |
I just wrote an important text and stored it as a simple text file. Then i accidentally cut out the content (with Ctrl+X) when i just wanted to copy it, and saved the file. Now it is of course empty. Is there any possibility to get the content back?
Any help is very much appreciated, it really took some time to write... |
Solved it with help of the accepted answer here: Can overwritten files be recovered?
For larger files that may be in multiple non-contiguous blocks, I do this:
grep -a -b "text in the deleted file" /dev/sda1
13813610612:this is some text in the deleted file
which will give you the offset in bytes of the matching ... | Restore deleted text file content [duplicate] |
1,371,822,060,000 |
I tried a little experiment where I created 2 folders Dir1 and Dir2 inside my Desktop directory, such that Dir1 is parent of Dir2.
/home/username/Desktop/Dir1/Dir2
Then, I use cd to set my pwd as /home/username/Desktop/Dir1/Dir2.
Next I used rm -r /home/username/Desktop/Dir1 to remove the Dir1.
Now if I use pwd it s... |
Actually, Dir2 does exist, but the name Dir2 does not. Confused? :) The shell's current directory is still the directory referred by the name Dir2, and this keeps the directory still around. This is analogous to anonymous files. Normally, when a files link count goes to zero, the file is deleted and the inode freed. H... | Why does the pwd doesn't update after directory removal? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.