Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
544 views
Short command or alias to copy last command to clipboard
Often I'd like the command I just typed to put into the clipboard, and I'd like to do it from the command line. I came up with: alias cl="fc -ln -1 | sed 's/^\s*//' | xsel -b" To alias `cl` to that pipeline which seems to achieve the desired effect, but it seems complicated and has a trailing newlin...
Often I'd like the command I just typed to put into the clipboard, and I'd like to do it from the command line. I came up with: alias cl="fc -ln -1 | sed 's/^\s*//' | xsel -b" To alias cl to that pipeline which seems to achieve the desired effect, but it seems complicated and has a trailing newline that I don't want. Any obvious and simpler way which doesn't have a trailing newline?
BeeOnRope (559 rep)
May 4, 2019, 02:07 AM • Last activity: May 1, 2022, 08:53 PM
3 votes
3 answers
2512 views
How to use vim for editor when running fc?
I have a machine for which when I run `fc` it opens in the `nano` editor. How can I switch the editor to `vim` when I edit a command with `fc`?
I have a machine for which when I run fc it opens in the nano editor. How can I switch the editor to vim when I edit a command with fc?
leeand00 (4937 rep)
Jun 8, 2018, 06:40 AM • Last activity: Jan 12, 2022, 05:41 PM
0 votes
1 answers
118 views
Can I configure Multipathig on FC Ports?
I have backup software which is installed on RHEL 7 Server. The connectivity between Data Domain and the Backup Server is as below: [![Architecture Diagram][1]][1] Zonning is configured on switch 1 and switch 2 as below: Alias For Data Domain HBA card 1: DD_HBA1_P1 DD_HBA1_P2 Alias For Data Domain H...
I have backup software which is installed on RHEL 7 Server. The connectivity between Data Domain and the Backup Server is as below: Architecture Diagram Zonning is configured on switch 1 and switch 2 as below: Alias For Data Domain HBA card 1: DD_HBA1_P1 DD_HBA1_P2 Alias For Data Domain HBA card 2: DD_HBA2_P1 DD_HBA2_P2 Alias for Server 001 HBA Card 1: Server001_HBA1_P1 Server001_HBA1_P2 Alias for Server 001 HBA Card 2: Server001_HBA2_P1 Server001_HBA2_P2 As Server001 is initiator and there are 4 ports so I created 4 zones for each initiator. Data Domain storage is configured as open storage in the backup software. We Can't see the disk mounted on the OS. Data Domain is visible on OS as a character device . I have few queries as below: 1. Is multipathing required on server001 ? If not then why? 2. Can I configure multipathing on FC Ports? if Yes, Please guide me by sharing the steps or KB article.
Puneet Dixit (169 rep)
Feb 13, 2020, 06:59 PM • Last activity: Apr 27, 2020, 04:21 PM
3 votes
2 answers
611 views
edit-and-execute-command interrupted by SIGTSTP
I've been using bash's [`edit-and-execute-command` function](https://git.savannah.gnu.org/cgit/bash.git/tree/bashline.c?id=3ba697465bc74fab513a26dea700cc82e9f4724e#n935): > **`edit-and-execute-command (C-x C-e)`** > > Invoke an editor on the current command line, and execute the result as shell comm...
I've been using bash's [edit-and-execute-command function](https://git.savannah.gnu.org/cgit/bash.git/tree/bashline.c?id=3ba697465bc74fab513a26dea700cc82e9f4724e#n935) : > **edit-and-execute-command (C-x C-e)** > > Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order. https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html I've noticed that if I invoke an editor, use Ctrl-Z to put it into the background, and then use fg to put it back into the foreground, the shell no longer executes the temporary file. This is handy if I want to abort the command, but I found the behavior a little surprising the first time it happened. My questions: - Why does this happen? I know from the source code that [edit_and_execute_command eventually calls fc](https://git.savannah.gnu.org/cgit/bash.git/tree/bashline.c?id=3ba697465bc74fab513a26dea700cc82e9f4724e#n957) , but it's not immediately clear to me *why* sending SIGTSTP prevents bash from executing the temporary file. - If I had accidentally hit Ctrl-Z and still wanted to execute the script in the temporary file still open by the editor, what would be the best way of doing that?
Nathaniel M. Beaver (1398 rep)
Jul 3, 2019, 10:56 PM • Last activity: Jan 24, 2020, 11:43 AM
0 votes
0 answers
868 views
HPE MSA-2050, FC extremely slow read/write
There's HP DL380 Gen10 server (dual Xeon Silver 4110 2.10GHz, 128Gb RAM, qlogic qla2xxx ) running debian 9.8, acting as database sever (percona server-5.6.43-84.3). Mysql data directory is connected over FC to HPE MSA-2050 (raid 10 of 14 SAS HDD 900Gb 15K, one disk group, one pool, one volume of 2.5...
There's HP DL380 Gen10 server (dual Xeon Silver 4110 2.10GHz, 128Gb RAM, qlogic qla2xxx ) running debian 9.8, acting as database sever (percona server-5.6.43-84.3). Mysql data directory is connected over FC to HPE MSA-2050 (raid 10 of 14 SAS HDD 900Gb 15K, one disk group, one pool, one volume of 2.5 Tb of ext4) on speed 16Gbps. One optical link is used (no muptipath). Next things happen: when testing random read/write speed, using sysbench, the speed is about 10/8 M/s which is extremely slow. So, mysql I/O is also on same speed. But with sequential read/write tests speed grows to 800/600 M/s. Same speed is when using dd to write data, when doing copy operation or any sequentional file operations. Tried different options of pool and volumes in HPE MSA - no luck. SAN volume is mounted with options /dev/sde1 on /mysql-data type ext4 (rw,noatime,stripe=256,data=ordered) With this test: `sysbench --test=fileio --file-total-size=150G prepare sysbench --test=fileio --file-total-size=150G --file-test-mode=rndrd --max-time=100 --max-requests=0 run` result is: Number of threads: 1 Initializing random number generator from current time Extra file open flags: (none) 128 files, 1.1719GiB each 150GiB total file size Block size 16KiB Number of IO requests: 0 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random read test Initializing worker threads... Threads started! File operations: reads/s: 561.86 writes/s: 0.00 fsyncs/s: 0.00 Throughput: read, MiB/s: 8.78 written, MiB/s: 0.00 General statistics: total time: 100.0053s total number of events: 56191 Latency (ms): min: 0.01 avg: 1.78 max: 111.23 95th percentile: 11.65 sum: 99924.80 Threads fairness: events (avg/stddev): 56191.0000/0.00 execution time (avg/stddev): 99.9248/0.00 When startng with sysbench --test=fileio --file-total-size=150G --file-test-mode=seqrd --max-time=100 --max-requests=0 run result is: Running the test with following options: Number of threads: 1 Initializing random number generator from current time Extra file open flags: (none) 128 files, 1.1719GiB each 150GiB total file size Block size 16KiB Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing sequential read test Initializing worker threads... Threads started! File operations: reads/s: 31642.04 writes/s: 0.00 fsyncs/s: 0.00 Throughput: read, MiB/s: 494.41 written, MiB/s: 0.00 General statistics: total time: 100.0008s total number of events: 3164351 Latency (ms): min: 0.00 avg: 0.03 max: 32.77 95th percentile: 0.06 sum: 98523.42 Threads fairness: events (avg/stddev): 3164351.0000/0.00 execution time (avg/stddev): 98.5234/0.00 The similar results with random write and sequentional write. What can be wrong?
Someone (303 rep)
May 22, 2019, 02:02 PM
2 votes
1 answers
1158 views
Viewing Port Info FC Solaris 11
I have a hba card with two ports (port 0) and (port 1) and I want to know how can obtaining using OS the info to mapping the wwn that I can see using fcinfo hba-port command to a port of the hba card. For example: If I have a WWN ending on xxxx890B, see that wwn is on port 0 of the hba card.
I have a hba card with two ports (port 0) and (port 1) and I want to know how can obtaining using OS the info to mapping the wwn that I can see using fcinfo hba-port command to a port of the hba card. For example: If I have a WWN ending on xxxx890B, see that wwn is on port 0 of the hba card.
vicdeveloper (379 rep)
Feb 14, 2019, 09:04 PM • Last activity: Feb 27, 2019, 08:02 PM
1 votes
2 answers
5401 views
How to check that which storage connected either FC or iscsi
How do i check that, which type of storage are connected with my linux(Redhat) system. I want to find that either ISCSI or FC storage connect ?
How do i check that, which type of storage are connected with my linux(Redhat) system. I want to find that either ISCSI or FC storage connect ?
Nullpointer (603 rep)
Jan 31, 2019, 05:23 PM • Last activity: Feb 6, 2019, 04:17 PM
-1 votes
1 answers
1603 views
fc-list is empty
Some time ago I deleted a lot of packages from a VPS that seemed to be needed only for visual programs (I got the list from some other question here, I don't remember where exactly). Now I'm running into trouble when trying to run Chrome Headless, I see the error `[1107/124949.591619:FATAL:platform_...
Some time ago I deleted a lot of packages from a VPS that seemed to be needed only for visual programs (I got the list from some other question here, I don't remember where exactly). Now I'm running into trouble when trying to run Chrome Headless, I see the error [1107/124949.591619:FATAL:platform_font_linux.cc(83)] Check failed: InitDefaultFont(). Could not find the default font, which after some time I related to the fact that the output of fc-list in this system is entirely blank. This is happening even though I've installed a lot of font packages already (with apt), mirroring the font packages installed in my desktop. It seems, however, that some package that would recognize these fonts is still missing, or some configuration file that would tell where these fonts are, I don't know.
fiatjaf (155 rep)
Nov 7, 2018, 01:26 PM • Last activity: Nov 7, 2018, 01:40 PM
2 votes
2 answers
964 views
Alternative of bash's `history -p` in zsh?
In bash, `history -p` does history expansion on its argument; What is the alternative in zsh?
In bash, history -p does history expansion on its argument; What is the alternative in zsh?
HappyFace (1694 rep)
Sep 3, 2018, 11:38 AM • Last activity: Sep 7, 2018, 10:47 AM
4 votes
0 answers
166 views
FreeBSD sh: is it possible to import a list of commands into fc without executing them?
I cannot find any indication that sh supports persistent history. So I am trying to create this functionality manually. At the end of my .shrc history I have added this: trap -- 'fc -ln -- 1 >> "$HOME/.sh_history"' EXIT This ensures that every time I exit the shell that the commands I have entered i...
I cannot find any indication that sh supports persistent history. So I am trying to create this functionality manually. At the end of my .shrc history I have added this: trap -- 'fc -ln -- 1 >> "$HOME/.sh_history"' EXIT This ensures that every time I exit the shell that the commands I have entered in that session are not lost in wind. Now that I have the saving history bit sorted out, I am wanting to import all commands in ~/.sh_history into fc upon logging in so that I can call commands from previous shell sessions. I realize that it won't be quite as simple as this because I will have to find a way to make sure that I only append new commands to the end of ~.sh_history, but I am confident I can hack it out provided that it is even possible to give a list of commands to fc without executing them.
Harold Fischer (1974 rep)
Jul 2, 2018, 01:14 AM
Showing page 1 of 10 total questions