How to redirect the output of `apt-file update` into a file?
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I have a zsh function which updates my system (.deb
packages, pip
packages, texlive packages, ...).
It looks like this:
up() tee -a "$LOGFILE"
The last line calls the __update_system
function and pipes its output to tee
, which in turn should display the output on the terminal, and append it to a file, so that I can review it later if something went wrong.
One of the commands executed by __update_system
is:
$ apt-file update
It seems to be executed, but its output is not logged in the file.
All the other commands (including aptitude update
) are logged.
I tried to understand by executing this command in a shell:
$ apt-file update >/tmp/log
Again, apt-file update
seems to be executed, but the output is not logged as /tmp/log
is empty.
I thought that maybe the output is sent on the standard error, so I tried:
$ apt-file update >/tmp/log 2>&1
But I got the same result, an empty file.
I tried in bash, which also gave me an empty file.
Here are some details about my system:
$ uname -a
Linux ubuntu 4.4.0-135-generic #161-Ubuntu SMP Mon Aug 27 10:45:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
About zsh:
$ zsh --version
zsh 5.5.1-dev-0 (x86_64-pc-linux-gnu)
About bash:
$ bash --version
GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu)
About apt-file
:
$ aptitude show apt-file
Package: apt-file
State: installed
Automatically installed: no
Version: 2.5.5ubuntu1
Priority: optional
Section: universe/admin
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 92,2 k
Depends: perl, curl, libconfig-file-perl, libapt-pkg-perl, liblist-moreutils-perl, libregexp-assemble-perl,
libfile-temp-perl
Suggests: openssh-client, sudo
Description: search for files within Debian packages (command-line interface)
apt-file is a command line tool for searching files contained in packages for the APT packaging system. You can search
in which package a file is included or list the contents of a package without installing or fetching it.
How to redirect the output of apt-file update
into a file?
command-line apt package-management updates
New contributor
add a comment |Â
up vote
5
down vote
favorite
I have a zsh function which updates my system (.deb
packages, pip
packages, texlive packages, ...).
It looks like this:
up() tee -a "$LOGFILE"
The last line calls the __update_system
function and pipes its output to tee
, which in turn should display the output on the terminal, and append it to a file, so that I can review it later if something went wrong.
One of the commands executed by __update_system
is:
$ apt-file update
It seems to be executed, but its output is not logged in the file.
All the other commands (including aptitude update
) are logged.
I tried to understand by executing this command in a shell:
$ apt-file update >/tmp/log
Again, apt-file update
seems to be executed, but the output is not logged as /tmp/log
is empty.
I thought that maybe the output is sent on the standard error, so I tried:
$ apt-file update >/tmp/log 2>&1
But I got the same result, an empty file.
I tried in bash, which also gave me an empty file.
Here are some details about my system:
$ uname -a
Linux ubuntu 4.4.0-135-generic #161-Ubuntu SMP Mon Aug 27 10:45:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
About zsh:
$ zsh --version
zsh 5.5.1-dev-0 (x86_64-pc-linux-gnu)
About bash:
$ bash --version
GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu)
About apt-file
:
$ aptitude show apt-file
Package: apt-file
State: installed
Automatically installed: no
Version: 2.5.5ubuntu1
Priority: optional
Section: universe/admin
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 92,2 k
Depends: perl, curl, libconfig-file-perl, libapt-pkg-perl, liblist-moreutils-perl, libregexp-assemble-perl,
libfile-temp-perl
Suggests: openssh-client, sudo
Description: search for files within Debian packages (command-line interface)
apt-file is a command line tool for searching files contained in packages for the APT packaging system. You can search
in which package a file is included or list the contents of a package without installing or fetching it.
How to redirect the output of apt-file update
into a file?
command-line apt package-management updates
New contributor
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I have a zsh function which updates my system (.deb
packages, pip
packages, texlive packages, ...).
It looks like this:
up() tee -a "$LOGFILE"
The last line calls the __update_system
function and pipes its output to tee
, which in turn should display the output on the terminal, and append it to a file, so that I can review it later if something went wrong.
One of the commands executed by __update_system
is:
$ apt-file update
It seems to be executed, but its output is not logged in the file.
All the other commands (including aptitude update
) are logged.
I tried to understand by executing this command in a shell:
$ apt-file update >/tmp/log
Again, apt-file update
seems to be executed, but the output is not logged as /tmp/log
is empty.
I thought that maybe the output is sent on the standard error, so I tried:
$ apt-file update >/tmp/log 2>&1
But I got the same result, an empty file.
I tried in bash, which also gave me an empty file.
Here are some details about my system:
$ uname -a
Linux ubuntu 4.4.0-135-generic #161-Ubuntu SMP Mon Aug 27 10:45:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
About zsh:
$ zsh --version
zsh 5.5.1-dev-0 (x86_64-pc-linux-gnu)
About bash:
$ bash --version
GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu)
About apt-file
:
$ aptitude show apt-file
Package: apt-file
State: installed
Automatically installed: no
Version: 2.5.5ubuntu1
Priority: optional
Section: universe/admin
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 92,2 k
Depends: perl, curl, libconfig-file-perl, libapt-pkg-perl, liblist-moreutils-perl, libregexp-assemble-perl,
libfile-temp-perl
Suggests: openssh-client, sudo
Description: search for files within Debian packages (command-line interface)
apt-file is a command line tool for searching files contained in packages for the APT packaging system. You can search
in which package a file is included or list the contents of a package without installing or fetching it.
How to redirect the output of apt-file update
into a file?
command-line apt package-management updates
New contributor
I have a zsh function which updates my system (.deb
packages, pip
packages, texlive packages, ...).
It looks like this:
up() tee -a "$LOGFILE"
The last line calls the __update_system
function and pipes its output to tee
, which in turn should display the output on the terminal, and append it to a file, so that I can review it later if something went wrong.
One of the commands executed by __update_system
is:
$ apt-file update
It seems to be executed, but its output is not logged in the file.
All the other commands (including aptitude update
) are logged.
I tried to understand by executing this command in a shell:
$ apt-file update >/tmp/log
Again, apt-file update
seems to be executed, but the output is not logged as /tmp/log
is empty.
I thought that maybe the output is sent on the standard error, so I tried:
$ apt-file update >/tmp/log 2>&1
But I got the same result, an empty file.
I tried in bash, which also gave me an empty file.
Here are some details about my system:
$ uname -a
Linux ubuntu 4.4.0-135-generic #161-Ubuntu SMP Mon Aug 27 10:45:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
About zsh:
$ zsh --version
zsh 5.5.1-dev-0 (x86_64-pc-linux-gnu)
About bash:
$ bash --version
GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu)
About apt-file
:
$ aptitude show apt-file
Package: apt-file
State: installed
Automatically installed: no
Version: 2.5.5ubuntu1
Priority: optional
Section: universe/admin
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 92,2 k
Depends: perl, curl, libconfig-file-perl, libapt-pkg-perl, liblist-moreutils-perl, libregexp-assemble-perl,
libfile-temp-perl
Suggests: openssh-client, sudo
Description: search for files within Debian packages (command-line interface)
apt-file is a command line tool for searching files contained in packages for the APT packaging system. You can search
in which package a file is included or list the contents of a package without installing or fetching it.
How to redirect the output of apt-file update
into a file?
command-line apt package-management updates
command-line apt package-management updates
New contributor
New contributor
New contributor
asked 4 hours ago
user938271
1283
1283
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
apt-file
is a perl script.- It uses diffindex-download. That is another perl script.
- That one writes to
/dev/tty
and not tostdout
(the difference is explained on this SO answer) Soooo... this will log the output to
logfile.log
script -c "apt-file update" logfile.log
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
apt-file
is a perl script.- It uses diffindex-download. That is another perl script.
- That one writes to
/dev/tty
and not tostdout
(the difference is explained on this SO answer) Soooo... this will log the output to
logfile.log
script -c "apt-file update" logfile.log
add a comment |Â
up vote
7
down vote
accepted
apt-file
is a perl script.- It uses diffindex-download. That is another perl script.
- That one writes to
/dev/tty
and not tostdout
(the difference is explained on this SO answer) Soooo... this will log the output to
logfile.log
script -c "apt-file update" logfile.log
add a comment |Â
up vote
7
down vote
accepted
up vote
7
down vote
accepted
apt-file
is a perl script.- It uses diffindex-download. That is another perl script.
- That one writes to
/dev/tty
and not tostdout
(the difference is explained on this SO answer) Soooo... this will log the output to
logfile.log
script -c "apt-file update" logfile.log
apt-file
is a perl script.- It uses diffindex-download. That is another perl script.
- That one writes to
/dev/tty
and not tostdout
(the difference is explained on this SO answer) Soooo... this will log the output to
logfile.log
script -c "apt-file update" logfile.log
answered 4 hours ago
Rinzwind
197k25377510
197k25377510
add a comment |Â
add a comment |Â
user938271 is a new contributor. Be nice, and check out our Code of Conduct.
user938271 is a new contributor. Be nice, and check out our Code of Conduct.
user938271 is a new contributor. Be nice, and check out our Code of Conduct.
user938271 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1074936%2fhow-to-redirect-the-output-of-apt-file-update-into-a-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password