cut / grep df -h
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?
Filesystem Size Used Avail Use% Mounted on
vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07
linux text-processing disk-usage columns
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?
Filesystem Size Used Avail Use% Mounted on
vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07
linux text-processing disk-usage columns
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?
Filesystem Size Used Avail Use% Mounted on
vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07
linux text-processing disk-usage columns
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?
Filesystem Size Used Avail Use% Mounted on
vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07
linux text-processing disk-usage columns
linux text-processing disk-usage columns
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 7 mins ago


Jeff Schaller
32.9k849111
32.9k849111
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 hour ago


Luan Pham
61
61
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago
add a comment |Â
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
5
down vote
Use awk
awk 'print $4'
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'
or cut
:
cut -d" " -f4
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4
or grep
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'
grep -o 'b3.1Tb'
3.1T
b in a regular expression means "word boundary".
-o, --only-matching
given the Linux tag, it might be worth mentioning--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
add a comment |Â
up vote
1
down vote
try the below command,
df -h | grep /vstorage/cluster07 | awk 'print $4'
add a comment |Â
up vote
0
down vote
With sed:
df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'
add a comment |Â
up vote
0
down vote
Tell df
what to output:
df -h --output=avail | tail -n1
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
Use awk
awk 'print $4'
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'
or cut
:
cut -d" " -f4
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4
or grep
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'
grep -o 'b3.1Tb'
3.1T
b in a regular expression means "word boundary".
-o, --only-matching
given the Linux tag, it might be worth mentioning--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
add a comment |Â
up vote
5
down vote
Use awk
awk 'print $4'
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'
or cut
:
cut -d" " -f4
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4
or grep
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'
grep -o 'b3.1Tb'
3.1T
b in a regular expression means "word boundary".
-o, --only-matching
given the Linux tag, it might be worth mentioning--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Use awk
awk 'print $4'
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'
or cut
:
cut -d" " -f4
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4
or grep
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'
grep -o 'b3.1Tb'
3.1T
b in a regular expression means "word boundary".
-o, --only-matching
Use awk
awk 'print $4'
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'
or cut
:
cut -d" " -f4
3.1T
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4
or grep
echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'
grep -o 'b3.1Tb'
3.1T
b in a regular expression means "word boundary".
-o, --only-matching
edited 33 secs ago
answered 1 hour ago
Goro
4,77352358
4,77352358
given the Linux tag, it might be worth mentioning--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
add a comment |Â
given the Linux tag, it might be worth mentioning--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
given the Linux tag, it might be worth mentioning
--output
– Jeff Schaller
6 mins ago
given the Linux tag, it might be worth mentioning
--output
– Jeff Schaller
6 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
@JeffSchaller. Kindly where?
– Goro
2 mins ago
add a comment |Â
up vote
1
down vote
try the below command,
df -h | grep /vstorage/cluster07 | awk 'print $4'
add a comment |Â
up vote
1
down vote
try the below command,
df -h | grep /vstorage/cluster07 | awk 'print $4'
add a comment |Â
up vote
1
down vote
up vote
1
down vote
try the below command,
df -h | grep /vstorage/cluster07 | awk 'print $4'
try the below command,
df -h | grep /vstorage/cluster07 | awk 'print $4'
answered 58 mins ago
EBIN GLADSON
976
976
add a comment |Â
add a comment |Â
up vote
0
down vote
With sed:
df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'
add a comment |Â
up vote
0
down vote
With sed:
df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'
add a comment |Â
up vote
0
down vote
up vote
0
down vote
With sed:
df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'
With sed:
df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'
answered 56 mins ago


Hkoof
89966
89966
add a comment |Â
add a comment |Â
up vote
0
down vote
Tell df
what to output:
df -h --output=avail | tail -n1
add a comment |Â
up vote
0
down vote
Tell df
what to output:
df -h --output=avail | tail -n1
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Tell df
what to output:
df -h --output=avail | tail -n1
Tell df
what to output:
df -h --output=avail | tail -n1
answered 1 min ago
RoVo
1,665213
1,665213
add a comment |Â
add a comment |Â
Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.
Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.
Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
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%2funix.stackexchange.com%2fquestions%2f471790%2fcut-grep-df-h%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
Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago